Deep Dive into the SharePoint Content Deployment and Migration API - Part 1
[Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6]
Introduction
Today I would like to start an article series on an interesting new feature in WSS 3.0: the Content Deployment and Migration API. A similar API has previously been provided in MCMS 2002 and was also added to WSS after MCMS was integrated in MOSS 2007. This first part will provide an overview about the API itself. In future chapters I will then demonstrate how to utlize this API to enhance your own applications or to get a better granularity than the out of the box tools allow you to do - e.g. how to copy a document library or a list to a different site collection.
WSS and MOSS use this API at various different places:
- Content Deployment
- STSADM -o export and import
- Copy/Move operations in Site Manager
- Variations
- MCMS 2002 database migration to MOSS 2007
Actually any time when content needs to be copied or moved to a different location either in the same or in a different site collection.

Feature set of the Content Deployment and Migration API
The Content Deployment and Migration API provides the following features:
-
export an entire site collection
-
export a specific site inside a site collection including or excluding content in subsites
-
export a list or document libraries or even of a folder inside a document library
-
export a single list items or documents from a document library
-
export dependent objects (like images referenced by a page) by following links
-
generate as a compressed export file or in uncompressed format
-
allow export with a define a maximum size for the generated compressed file (multiple export files will be created if required)
-
allow incremental export of items based on a given change token. This will export all items that have been created, changed or deleted after the timestamp in the change token.
-
import the exported content with or without identiy preservation (means items will keep their GUID or not)
-
import the exported content under the same or a differnt parent in the destination database
-
do link fixup during import
For people who have also worked with Microsoft Content Management Server (MCMS) 2002 here is a feature comparison between the site deployment API of CMS 2002 and the content deployment and migration API coming with WSS:
| |
|
MCMS 2002 |
|
WSS 3.0 |
| incremental deployment |
|
yes |
|
yes |
| full deployment |
|
no |
|
yes |
| deployment of a subtree of the site structure |
|
yes |
|
yes |
| deployment of specific selected items |
|
no |
|
yes |
| deployment of dependent items |
|
yes |
|
yes |
| deployment by ignoring the dependencies |
|
no |
|
yes |
| deployment of child elements of the exported elements |
|
yes |
|
yes |
| deployment without exporting of child elements |
|
no |
|
yes |
| import with preservation of the last modified date of the source item |
|
no |
|
yes |
| import without preservation of the last modified date of the source item |
|
yes |
|
yes |
| export of image libraries/resource galleries |
|
no |
|
yes |
| support import at multiple locations in the site hierarchy |
|
no |
|
yes |
| can be used to migrate 3rd party content |
|
no |
|
yes | |
Programming Reference
Assembly: Microsoft.SharePoint.dll
Namespace: Microsoft.SharePoint.Deployment
Important Objects:
-
SPExport - controls the Export process
-
SPExportSettings - used to configure the export process
-
SPExportObject - defines which objects need to be exported
-
SPImport - controls the import process
-
SPImportSettings - used to configure the import process
You will find details about these objects in the MSDN:
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.aspx
Rather than listing all the different properties and methods of these objects (which are already documented on MSDN) I will explain how to use these objects by providing some "real-world" samples in the next chapters:
-
Part 2 - Providing some real world samples on export
-
Part 3 - Providing some real world samples on import
-
Part 4 - Advanced content deployment scenarios
-
Part 5 - Avoiding common problems
-
Part 6 - Requirements for a successful content deployment