Stefan Goßner

Senior Escalation Engineer for SharePoint (WSS, SPS, MOSS, SP2010) and MCMS

Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

[Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6 - Part 7]

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

Comments
  • Great set of articles by Stefan Goßner : Deep Dive Into the SharePoint Content Deployment...

  • MOSS / SharePoint Content Deployment

  • Having focused on deployment using Features for several articles, back in May I wrote an article titled

  • Back in May I wrote a post titled SharePoint deployment options : Features or Content Deployment? , which

  • Can you deploy content from a MOSS environment to a WSS environement?

  • Hi Jenny,

    MOSS is on top of WSS. As long as you are only using WSS features in the deployed content it will work. As soon as you are trying to deploy content that is bound to features which are only available in MOSS it will fail.

    Cheers,

    Stefan

  • Around the time work started on a long whitepaper about migrating content files from SharePoint server

  • Around the time work started on a long whitepaper about migrating content files from SharePoint server

  • FYI... the diagram is truncated on the right.

  • Maybe on your screen.

    Not with a screen width of 1200 and more.

  • Hi Stefan

    I have been working with content deployment in MOSS2007. It worked well before. Currently I'm getting the following error:

    <?xml version="1.0" encoding="utf-8" ?>

    - <ArrayOfReportMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

     <ReportMessage Title="Unknown compression type in a cabinet folder" Time="2008-01-29T13:40:31.2983868Z" Severity="Error" Phase="ExportInProgress" />

     <ReportMessage Title="Failed to create package file. at Microsoft.SharePoint.Deployment.ExportDataFileManager.<>c__DisplayClass2.<Compress>b__0() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.Deployment.ExportDataFileManager.Compress(SPRequest request) at Microsoft.SharePoint.Deployment.SPExport.Run() *** Inner exception: Unknown compression type in a cabinet folder at Microsoft.SharePoint.Library.SPRequest.BuildCabinetFile(String bstrTempDirectory, String bstrCabFileLocation, UInt32 uMaxCabFileSize) at Microsoft.SharePoint.Deployment.ExportDataFileManager.<>c__DisplayClass2.<Compress>b__0()" Time="2008-01-29T13:40:35.5170828Z" Severity="Error" Phase="ExportInProgress" />

     <ReportMessage Title="Content deployment job 'NewCompletePushTest' failed.The exception thrown was 'Microsoft.SharePoint.SPException' : 'Failed to create package file.'" Time="2008-01-29T13:40:49.9387732Z" Severity="Error" Description="" Recommendation="" Phase="Failure" />

     </ArrayOfReportMessage>

    Here is the scenario:

    I have just completed installing wss service pack 1, and MOSS 2007. The replication now gives the error above. My topology is as follows: I have two farms located in different located geographically. It was working before. This is a full-deployment not incremental.

    please help

  • Hi Bramley,

    please open a support case for this. This is not an issue I have heard about till now.

    Cheers,

    Stefan

  • Hi Stefan

    Do you think this has any thing to do with compression of files. How can I remove compression. I'm using MOSS - Central Administration for content deployment. This issue affect the increment updates. I get the following error for incremental:

    <?xml version="1.0" encoding="utf-8" ?>

    - <ArrayOfReportMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

     <ReportMessage Title="The changeToken refers to a time before the start of the current change log." Time="2008-01-29T20:39:04.6175572Z" Severity="Error" ObjectName="/" Phase="ExportInProgress" />

     <ReportMessage Title="The changeToken refers to a time before the start of the current change log. at Microsoft.SharePoint.Deployment.SPExport.ThrowInvalidChangeTokenError(DateTime minChangeTime, Int32 minChangeNumber) at Microsoft.SharePoint.Deployment.SPExport.GetIncrementalChanges() at Microsoft.SharePoint.Deployment.SPExport.CalculateObjectsToExport() at Microsoft.SharePoint.Deployment.SPExport.Run()" Time="2008-01-29T20:39:04.8363044Z" Severity="Error" Phase="ExportInProgress" />

     <ReportMessage Title="Content deployment job 'NewCompletePushTest' failed.The exception thrown was 'Microsoft.SharePoint.SPException' : 'The changeToken refers to a time before the start of the current change log.'" Time="2008-01-29T20:39:05.8362916Z" Severity="Error" Description="" Recommendation="" Phase="Failure" />

     </ArrayOfReportMessage>

    Any help will do.

  • Hi Bramley,

    sure it is related to compression. The error message implies this.

    The error for the incremental deployment indicates that your database is older than the last deployment.

    This can happen if you have restored an older backup of the database. Then the deployment job definition does no longer fit to the source database.

    Cheers,

    Stefan

  • 在使用SharePoint的时候我们常常需要做这样一个操作:把某个列表(或文档库)从一个网站转移到另一个网站上去。

    比较常见的做法是,把这个列表存为模板文件,然后再在新的网站位置创建一遍。但这种方法...

Page 2 of 8 (111 items) 12345»
Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post