Click to Rate and Give Feedback

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (1)
SPExport Class (Microsoft.SharePoint.Deployment)
Supports export of specified content from a source Windows SharePoint Services site collection to a CAB file (with .cmp file extension) in XML format.

Namespace: Microsoft.SharePoint.Deployment
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public NotInheritable Class SPExport
    Inherits SPDeployment
Visual Basic (Usage)
Dim instance As SPExport
C#
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class SPExport : SPDeployment

This class participates with other classes in the Deployment namespace to support import, export, publication, and migration of Windows SharePoint content, as well as supporting backup and restore capabilities.

You can initiate an export operation by first initializing an instance of the Microsoft.SharePoint.Deployment.SPExportSettings class with the required export settings and then passing the SPExportSettings object to the constructor of SPExport class; you then call the SPExport.Run method.

The following code example demonstrates how to perform a full export of an entire site collection.

[C#]

SPExportSettings settings = new SPExportSettings();
settings.SiteUrl = "http://servername:80";
settings.FileLocation = @"c:\exportdata";
settings.BaseFileName = "exportfile.cmp";
settings.FileCompression = true;
settings.ExportMethod = SPExportMethodType.ExportAll;

SPExport export = new SPExport(settings);
export.Run();

The following code example demonstrates how to perform an incremental export. Notice that the code sets the ExportMethod property to ExportChanges and then provides a change token.

[C#]

settings.ExportMethod = SPExportMethodType.ExportChanges;
settings.ExportChangeToken = "1;1;87a71761-2987-48eb-9d29-48428270e01;632937036861200000;5512";
System.Object
   Microsoft.SharePoint.Deployment.SPDeployment
    Microsoft.SharePoint.Deployment.SPExport
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker