17.5. Using the Content Migration API
The content migration API (Microsoft.SharePoint.Deployment) provides the capability to support disconnected and granular deployment scenarios by enabling different phases of the deployment to happen at different times. The exported content is packaged as a Content Migration Package (*.CMP) file, which can easily be transported to the destination environment via common mechanisms such as FTP or removable media such as DVDs. These CMP files are cabinet files with a different extension and by default their maximum size is 24MB. Content migration actually underpins a number of MOSS features, including content deployment, variations, the Manage Site Content and Structure tool, and the MCMS migration capability.
The following console application in Listing 17-2 shows how to use the content migration API to export content to a *.CMP file.
Example 17-2. Exporting content with the content migration API
using System; using System.Collections.Generic; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Deployment; namespace WROX.ProMossWcm.Chapter17 { class Program { private static string _sourceUrl = "http://cdsource"; static void Main(string[] args) { try { SPExportSettings exportSettings = new SPExportSettings(); // echo output exportSettings.CommandLineVerbose = true; // CMP file to export exportSettings.BaseFileName = "export.cmp"; // Path to export CMP exportSettings.FileLocation = @"C:\windows\temp"; exportSettings.OverwriteExistingDataFile ... |
Get Professional SharePoint® 2007 Web Content Management Development: Building Publishing Sites with Office SharePoint Server 2007 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.