<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Microsoft SharePoint Developer Documentation Team Blog : content migration</title><link>http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/content+migration/default.aspx</link><description>Tags: content migration</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Overview of Backing Up and Restoring Data in Windows SharePoint Services</title><link>http://blogs.msdn.com/sharepointdeveloperdocs/archive/2008/01/23/overview-of-backing-up-and-restoring-data-in-windows-sharepoint-services.aspx</link><pubDate>Thu, 24 Jan 2008 01:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7212945</guid><dc:creator>RickK</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/sharepointdeveloperdocs/comments/7212945.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sharepointdeveloperdocs/commentrss.aspx?PostID=7212945</wfw:commentRss><description>&lt;H1 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana size=5&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H2 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=3&gt;Introduction&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;This post provides some basic facts about backing up and restoring data in Windows SharePoint Services 3.0. It will serve as background information for several developer-oriented posts that I will create in the next couple of weeks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertTextinList1 style="MARGIN: 3pt 0in 3pt 0.5in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;: Unless explicitly stated otherwise, all classes and members referenced in this post are in the &lt;B style="mso-bidi-font-weight: normal"&gt;Microsoft.SharePoint.Administration.Backup&lt;/B&gt; namespace. &lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=3&gt;What Can Be Backed Up and What Can Be Restored&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;There are six &lt;EM&gt;types&lt;/EM&gt; of content components built-in to Windows SharePoint Services 3.0 that can be backed up and restored through either the Central Administration application's UI, the &lt;A class="" href="http://blogs.msdn.com/Office/en-us/library/188f006d-aa66-4784-a65b-a31822aa13f71033.mspx" target=_blank mce_href="http://blogs.msdn.com/Office/en-us/library/188f006d-aa66-4784-a65b-a31822aa13f71033.mspx"&gt;Stsadm.exe Command-line Tool&lt;/A&gt; or a custom application that uses the Windows SharePoint Services 3.0 backup and restore object model. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Site collections, each of which might contain multiple Web sites.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Content databases, each of which might contain multiple site collections.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Web applications, each of which might contain multiple content databases.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Content publishing "Web services," each of which might contain multiple Web applications. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertTextinList1 style="MARGIN: 3pt 0in 3pt 0.5in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;: This refers to content publishing "Web services" (which are really partitions of content) that are represented in the object model by &lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;Microsoft.SharePoint.Administration.SPWebService&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; objects. It does not refer to the functional Web services in the more common sense of "Web service," such as the Alerts (&lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;websvcAlerts&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;) service or the Meetings (&lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;websvcMeetings&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;) service. For more information about content publishing "Web services," see &lt;SPAN class=LinkText&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms980916.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms980916.aspx"&gt;Server and Site Architecture: Object Model Overview&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; and &lt;SPAN class=LinkText&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;The High Level Object Model of Windows SharePoint Sevices 3.0&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; (to be published on MSDN). &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Search &lt;EM&gt;Windows&lt;/EM&gt; service including its databases and indexes. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertTextinList1 style="MARGIN: 3pt 0in 3pt 0.5in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;: This does not refer to the Search&amp;nbsp;&lt;EM&gt;Web&lt;/EM&gt; service &lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;websvcSPSearch&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;A whole Windows SharePoint Services farm. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;If an enhanced functionality product such as Office SharePoint Server 2007 has been installed in addition to Windows SharePoint Services 3.0 and that product includes Shared Service Providers, then they can also be backed up and restored with Windows SharePoint Services 3.0. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;In addition, you can create new types of content objects that can be backed up and restored by implementing the &lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;IBackupRestore&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; interface.&lt;/FONT&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=2&gt;Limitations&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;There are some limitations on what can be backed up and restored through either the Central Administration application's UI, the stsadm command line utility or a custom application that uses the Windows SharePoint Services 3.0 backup and restore object model. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;You cannot backup (or restore) an individual Web site, list, or list item except by backing up (or restoring) the entire site collection to which it belongs. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;You cannot back up a Windows SharePoint Services farm's configuration database or the content database of the Central Administration application except by backing up the whole farm. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;You cannot restore a farm's configuration database or the content database of the Central Administration application. The backups of these components that are included in a backup of a farm provide a snapshot of these components at the time of the backup. Such snapshots might be useful for troubleshooting because they can be used to compare with the present state of the components using SQL Server tools. (There is an exception to this point: you can restore the configuration database and the content database of the Central Administration application if you are using the Volume Shadow Copy Service – VSS - of Windows Server 2003/2008). &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;You cannot back up the Internet Information Server (IIS) metabase. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;The following kinds of content cannot be backed up with either the Central Administration application's UI or the stsadm command line utility, but you can create custom backup solutions with the Windows SharePoint Services SDK that include these types of content.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Registry keys.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Files that live on the front-end servers; that is, outside any content database, such as certain master pages, .ascx files, web.config files, and other configuration files. &lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=3&gt;Types of Backups and Restorations&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Backups of a given component can be either full or incremental. In the latter case, only parts of the component that have changed since the last full backup are backed up. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;: A Windows SharePoint Services Search index cannot be incrementally backed up. If a search index is included in an incremental backup job, the index will get a full backup. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Restorations can either overwrite the original backup source or they can be to a new location. This means that the backup and restore functionality in Windows SharePoint Services 3.0 can also be used as a method of migrating content components. &lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=3&gt;Two Kinds of Custom Backup Applications&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;There are two ways to use the Windows SharePoint Services object model to create custom backup applications. &lt;/FONT&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=2&gt;The Main Backup and Restore Object Model&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;You can create a backup and restore application by using the main backup and restore object model, sometimes called "catastrophic" backup/restore. This is located mainly in the &lt;SPAN class=CodeEntityReferenceQualified&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;Microsoft.SharePoint.Administration.Backup&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; namespace; but backups and restores of individual site collections are performed with the &lt;SPAN class=CodeEntityReferenceQualified&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;Microsoft.SharePoint.Administration.SPSiteCollection.Backup()&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; and &lt;SPAN class=CodeEntityReferenceQualified&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;Microsoft.SharePoint.Administration.SPSiteCollection.Restore()&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; methods. &lt;/FONT&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana color=#333333 size=2&gt;Interface to the Volume Shadow Copy Service&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Windows SharePoint Services 3.0 deployments can also take advantage of the Volume Shadow Copy Service (VSS) in Windows Server 2003/2008. Windows SharePoint Services 3.0 includes a Windows SharePoint Services VSS Writer service that will create shadow copies of native and custom content in the deployment. The service contains a VSS writer that will write shadow copies of all native Windows SharePoint Services 3.0 databases and all custom databases. Non-database custom components can also be registered with the service by using the &lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;SPVssComponentDefinition&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; and &lt;SPAN class=CodeEntityReference&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;SPVssDiscoveryHelper&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt; classes. It is also necessary that you create a VSS writer for any such non-database custom components. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;: With the VSS service, you can target only the whole farm or individual content databases for database shadow copy. Individual Web applications and individual content publishing "Web services" cannot be set for shadow copying independently of making a shadow copy of the whole farm. (For information about the meaning of "content publishing Web service" see the first note of this post.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7212945" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/content+migration/default.aspx">content migration</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/restore/default.aspx">restore</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/backup/default.aspx">backup</category></item><item><title>Content Migration in SharePoint (Post 2):</title><link>http://blogs.msdn.com/sharepointdeveloperdocs/archive/2007/12/05/content-migration-in-sharepoint-post-2.aspx</link><pubDate>Thu, 06 Dec 2007 02:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6672141</guid><dc:creator>NickG (msft)</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/sharepointdeveloperdocs/comments/6672141.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sharepointdeveloperdocs/commentrss.aspx?PostID=6672141</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana color=#c0c0c0 size=5&gt;&lt;STRONG&gt;Key Concepts in Selective Migration&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Picking up where the first post left off, today's foray explores the basic concepts of SharePoint content migration. Most of these concepts come into play in nearly every migration scenario where you use the&amp;nbsp;SharePoint.Deployment namespace APIs. This post covers the following concents:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Content selection (also known as "cherry picking")&lt;/LI&gt;
&lt;LI&gt;The content migration package (.cmp) file&lt;/LI&gt;
&lt;LI&gt;Object identity (that is, retaining object identity on import)&lt;/LI&gt;
&lt;LI&gt;Reparenting objects&lt;/LI&gt;
&lt;LI&gt;Handling content types when migrating a site collection&lt;/LI&gt;
&lt;LI&gt;Handling workflows when migrating&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content selection for export&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Once the initial full migration has occurred and the source and destination sites are established, selective migration relies on logic in your custom code for selection criteria that determines which items are selected for migration, and when. Also known as "cherry picking," this is the process through which specific items on the source site collection are migrated to the destination site collection based on selection criteria that is specified in the custom code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;In the basic scenario, logic in a code module associated with a timer job runs on a recurring schedule (for example, every 24 hours at 3:00 a.m.); the module examines date stamps or change logs (or both), then selects and exports only those files that have changed since the last migration. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;The operation relies on the identity of objects in the source and destination site collections. At import time, the destination recognizes objects by GUID identifiers and then updates their corresponding files accordingly.&lt;/FONT&gt;&lt;/P&gt;
&lt;H4 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content migration package (.cmp) file&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;The content migration package is a compressed cabinet (.cab) file that uses the .cmp file extension. The migration package (.cmp) file aggregates data for export from the source site, along with site structure and dependency data, and stores it as compressed, serialized XML files.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;While the export operation compresses site data by default, you can override this behavior and export uncompressed files by changing the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" title="FileCompression property" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spdeploymentsettings.filecompression.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spdeploymentsettings.filecompression.aspx"&gt;SPDeploymentSettings.FileCompression&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property to &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;. This property is on the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" title="SPDeploymentSettings class" href="http://msdn2.microsoft.com/en-us/library/ms471991.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms471991.aspx"&gt;SPDeploymentSettings&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; object.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;When using file compression, you must must specify the name of the compressed content migration (.cmp) file using the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spdeploymentsettings.basefilename.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spdeploymentsettings.basefilename.aspx"&gt;BaseFileName&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property on the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.aspx"&gt;SPExportSettings&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; object. The &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spdeploymentsettings.filelocation.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spdeploymentsettings.filelocation.aspx"&gt;FileLocation&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property specifies where the compressed file is located on the source server.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;By default, the .cmp files are limited to 24 MB in size, although you can change this using the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.filemaxsize.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.filemaxsize.aspx"&gt;FileMaxSize&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property. When site data exceeds the 24 MB limit, your site data is separated in to two or more migration files. However, where a single file exceeds the maximum file size, the operation resizes the .cmp file to accommodate the file. You can have any number of .cmp files.&lt;/FONT&gt;&lt;/P&gt;
&lt;H4 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Object identity&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;SharePoint objects are identified by GUID on the source server. Upon import, by default, the objects are assigned new GUIDs on import to the destination. To support selective migration scenarios, however, you must change the default and retain the identity of the object that you are exporting. This is very important, because the only way that files can successfully update their corresponding versions on the destination site is for the destination to recognize the object by its identifying GUID.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;You can retain object identity by setting the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimportsettings.retainobjectidentity.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimportsettings.retainobjectidentity.aspx"&gt;RetainObjectIdentity&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property on the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimportsettings.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimportsettings.aspx"&gt;SPImportSettings&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; object to &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;true&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;To use the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;RetainObjectIdentity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property to support selective migrations, you must also set the &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.exportmethod.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.exportmethod.aspx"&gt;ExportMethod&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property to the value &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;ExportChanges&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Retaining object identity should be used carefully, and in limited scenarios. It most commonly supports a publishing scenario in which source and one or more destination servers are mirror images — for example, where a development or test server is migrating updates to one or more production servers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;If you are creating a new site that you know in advance will receive file updates on a regular basis (for example, from a development or test server), you can enable a smooth link between the two by first doing a full migration from the source to a completely blank site, but with &lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=CodeEntityReference&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimportsettings.retainobjectidentity.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimportsettings.retainobjectidentity.aspx"&gt;RetainObjectIdentity&lt;/A&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt; property &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;set to &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;true&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;. It is very important, then, that you &lt;STRONG&gt;&lt;EM&gt;never modifythe destination&lt;/EM&gt;&lt;/STRONG&gt;. The initial migration established the mirrored hierarchy and mappings; any modifications to the destination can break the linkage. If this relationship gets broken, your only recourse is to delete the destination and then reestablish the linkage as originally done.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;In the scenario described above, you can use Stsadm.exe to complete the export portion of the migration, since it does not support the retention of object identity. However, you must use the migration APIs to complete the import portion of the migration in order to retain object identity.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;SharePoint content databases do not permit duplicate GUIDs or file names, so you must be careful when implementing this property. You should &lt;STRONG&gt;&lt;EM&gt;not&lt;/EM&gt;&lt;/STRONG&gt; retain object identity when you are simply updating files on the destination server, because the import operation cannot determine whether a file is new or an update, and will therefore place a duplicate copy of the file on the destination. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;This happens because the migration process uses GUID identifiers, but only down to the level of the item collection. Beneath that level, that is, for individual files, the system uses the file name. Consequently, the import simply copies over the updated version of the existing file and leaves the original intact, potentially creating duplicates. When the destination server then encounters duplicate file names, it cannot resolve the ambiguity and becomes unstable.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Important&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;When deleting files, it is very important to delete the files on both the source and destination servers. Not doing so can cause duplicate files names and an unstable site.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;To support field deletion (a feature that deletes previous versions of items on the source server when the migration updates and deletes the same file on the destination), the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;RetainObjectIdentity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property must be set to &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;true&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H4 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reparenting&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Now let's consider a much different scenario. Instead of a publishing scenario, in which objects on the source server have to map to their equivalent files on the destination server, consider instead a scenario in which a specific subweb or list item is migrated and you want to place it at a different place in the destination hierarchy. This is a very common requirement and you handle this by reparenting the object (or objects) on import.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;It's important to note that, as discussed in the section on retaining object identity, any time that you do not retain object identity, a migrated object will need a new parent specified on import. It doesn't matter if the destination site collection is the same site collection as the source or even if it is in the same database as the source site collection. It also doesn't matter if the destination site collection is in the same or a different farm as the source site collection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;If you export an item from a database without exporting its parent, then the item that you've exported will become orphaned in the content migration package, but that's not necessarily a problem. A package can contain multiple orphaned objects.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Having orphaned objects in the migration package is not a problem because the import method allows us to define a new parent for each of these orphaned objects. This is what is meant by "reparenting." However, objects that are exported with their parent objects keep their relationships during migration. So, for example, if you export Web A and Web B is a sub web of web A, then you can only change the parent of web A. The parent of Web B will remain as Web A, because Web B.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;There are two ways to reparent orphaned objects when importing. In the first, you import all of your orphaned objects into the same subweb, while in the other method you assign parent objects individually to each orphaned object.&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana color=#333333&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reparent by importing all orphans to the same subweb&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;You can reparent your orphan objects by simply importing all of them into the same subweb. However, this only works if all of the orphan objects are destined for the same subweb. For example, this is the preferred method if you have exported two or more list or document library objects and you want to import them all into the same subweb. This works even if the export objects are from different source sites. Here is some sample code for doing this. Of particular note are the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;WebUrl&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; and &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;RetainObjectIdentity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; properties.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;SPImportSettings settings = new SPImportSettings(); &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;settings.SiteUrl = "http://localhost:2001"; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;settings.WebUrl = "http://localhost:2001/MyDestinationWeb"; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;settings.FileLocation = @"c:\export"; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;settings.FileCompression = false; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;settings.RetainObjectIdentity = false; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;SPImport import = new SPImport(settings); &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;import.Run();&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;In the above example, the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;WebUrl&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property defines the site (the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;SPWeb&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;) that becomes the new parent for all orphaned objects in the export package. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;You cannot use this method to reparent orphaned objects if the migration package contains orphaned documents; SharePoint site cannot become the parent of a document document object (only list or folder objects can parent documents).&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Note, too, that the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;RetainObjectIdentity&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; property is set to &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;. This is important because keeping this property as false (which is the default) cases the operation to assign a new GUID to the orphaned objects, which is essential for reparenting those objects.&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana color=#333333&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reparent by assigning new parent objects individually&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Assigning new parents to orphaned objects individually is much more flexible than the previous method, but also requires more coding. In this approch, you must intercept the import operation to assign a new parent to each orphaned object after the operation has accumulated a list of all orphaned objects in the migration package. You can do this by implementing a custom event handler, as in the following example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;static void OnImportStarted(object sender, SPDeploymentEventArgs args) &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;{ &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPSite site = new SPSite("http://localhost:2001"); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPWeb web = site.RootWeb; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPImportObjectCollection rootObjects = args.RootObjects; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (SPImportObject io in rootObjects) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{ &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;io.TargetParentUrl = web.Url; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;web.dispose();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;site.dispose();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;}&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;This approach uses the RootObject collection of the event arguments to aggregate all and then reparent all of the orphan objects. Actually, we do much the same thing that we did when we imported all of the objects to the same subweb, that is, we defined a specific site (SPWeb) as the new parent of all included orphaned objects. However, notice how you can extend the logic in the event handler to, for example, assign different parents to different orphans based on object type, as shown here: &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;static void OnImportStarted(object sender, SPDeploymentEventArgs args) &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;{ &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPSite site = new SPSite("http://localhost:2001"); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPWeb web = site.RootWeb; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPList list = web.Lists["MyDocLib"]; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPImportObjectCollection rootObjects = args.RootObjects; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (SPImportObject io in rootObjects) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{ &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (io.Type == SPDeploymentObjectType.ListItem) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{ &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;io.TargetParentUrl = list.RootFolder.ServerRelativeUrl;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (io.Type == SPDeploymentObjectType.List) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{ &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;io.TargetParentUrl = web.Url; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;... &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face="Courier New" color=#000080&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;web.dispose();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;site.dispose();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;}&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;There is a great deal of flexibility here. In addition to reparenting based on the object type, you could instead look at the original &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;TargetParentUrl&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;, for example, to obtain the location of the source and then include that as part of your reparenting logic. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;The code example below shows us how to hook up the event handler to the import operation. You can do this as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;static void ImportDocLibItem() &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;{ &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPImportSettings settings = new SPImportSettings(); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;settings.SiteUrl = "http://localhost:2001"; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;settings.FileLocation = @"c:\deployment5"; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;settings.FileCompression = false; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;settings.RetainObjectIdentity = false; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;SPImport import = new SPImport(settings); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;EventHandler&amp;lt;SPDeploymentEventArgs&amp;gt; eventHandler = new EventHandler&amp;lt;SPDeploymentEventArgs&amp;gt;(OnImportStarted); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;import.Started += eventHandler; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;o:p&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;import.Run(); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 3pt"&gt;&lt;FONT face="Courier New" color=#000080&gt;} &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TableSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana color=#c0c0c0 size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Notice that you need to register the event handler with the import class before you start the import operation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;There are several more event handlers that you can register and use during import; these are explained in more details at help topics for &lt;/FONT&gt;&lt;SPAN class=MsoHyperlink&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimport_events.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spimport_events.aspx"&gt;SPImportEvents&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; and for &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexport_events.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexport_events.aspx"&gt;SPExportEvents&lt;/A&gt;. Similar events can also be registered for export, if required:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H4 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content types (handling)&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Migration operations that use the export and import commands include your content type definition schema files in the export package. However, in cases where content type definitions hold references to custom SharePoint features, you must manually install and configure on the destination compute the feature for which the content type holds a reference. Features that are native to the SharePoint server environment will have their type definition references restored automatically.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;On starting the import operation, you will receive a warning message that alerts you with the identity of custom features for which references must be recreated. You must resolve these references after completing the import.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;For more information about content types, see &lt;SPAN class=LinkText&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" title="Content Types" href="http://msdn2.microsoft.com/en-us/library/ms479905.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms479905.aspx"&gt;Content Types&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;. For more information about SharePoint features, see &lt;SPAN class=LinkText&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms460318.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms460318.aspx"&gt;Working with Features&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H4 style="MARGIN: 9pt 0in 3pt -0.25in"&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Workflows&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Workflows are not included in export packages so when you initially set up a migration target, you must copy any custom workflows that you have onto the destination server and reconfigure the workflow association table. This includes creating (or restoring on the destination) the workflow definitions files.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Of course, manually restoring your custom workflows on the migration destination is only necessary when you initially set up your destination server. Subsequently, when doing selective migrations in a publishing scenario, it is advantageous that workflows are excluded from the migration package.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;For more information about managing workflows, see the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=LinkText&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms434426.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms434426.aspx"&gt;Introduction to Workflows in Windows SharePoint Services&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=LinkText&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms416312.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms416312.aspx"&gt;Workflows in Windows SharePoint Services&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6672141" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/migration/default.aspx">migration</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/content+migration/default.aspx">content migration</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/deployment/default.aspx">deployment</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/Deployment+namespace/default.aspx">Deployment namespace</category></item><item><title>Content Migration in SharePoint</title><link>http://blogs.msdn.com/sharepointdeveloperdocs/archive/2007/11/30/content-migration-in-sharepoint.aspx</link><pubDate>Sat, 01 Dec 2007 01:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6620613</guid><dc:creator>NickG (msft)</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/sharepointdeveloperdocs/comments/6620613.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sharepointdeveloperdocs/commentrss.aspx?PostID=6620613</wfw:commentRss><description>&lt;P&gt;Around&amp;nbsp;the time work started on a long whitepaper&amp;nbsp;about migrating content files from SharePoint server "A" to SharePoint server "B" using the migration and deployment APIs in the Microsoft.SharePoint.Deployment namespace, I came across a series of blog posts by Stefan Go&lt;FONT face=Verdana&gt;β&lt;/FONT&gt;ner that covered the subject matter in detail. Many of you have probably seen Stefan's work:&amp;nbsp; &lt;A class="" title="Stefan's migration article" href="http://blogs.technet.com/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-1.aspx" mce_href="http://blogs.technet.com/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-1.aspx"&gt;&lt;STRONG&gt;Deep Dive into the SharePoint Content Deployment and Migration API, Parts 1-5&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I contacted Stefan and he agreed to collaborate. He's allowed me to use some of his code examples, and to expand on some of his points. Additionally, I've collaborated with the feature PM and lead developer on the migration/deployment APIs here at Microsoft, Patrick Simek, so the whitepaper treats the subject quite a bit more broadly than does Stefan's blog posts.&lt;/P&gt;
&lt;P&gt;I'll chunk this article up into segments for posting to this blog.&amp;nbsp; Comments are DEFINITELY welcome.&amp;nbsp; I'll be converting much of the content of this article (and these posts) into Help content in the SharePoint SDK documentation, so anything that helps to improve the quality of the content is highly desired.&amp;nbsp; Here's the first section:&lt;/P&gt;
&lt;H3&gt;The ABCs of Content Migration (Post 1) &lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Many scenarios require moving content from one SharePoint site to another. When the scenario calls for a full migration (that is, moving the entire contents of a SharePoint site or site collection), the task is relatively simple. Typically, you use either of two main approaches:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;Use the export and import operations in the Stsadm.exe utility to migrate data from one site to another.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;Alternatively, use SOAP calls to the &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Sites.ExportWeb and &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Sites.ImportWeb methods that are implemented on the Sites Web service to migrate data.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;However, both of these methods have limitations. Both limit you to migrating only a full SharePoint site, or site collection. In addition, neither allows you to retain object identity during the migration operation. Retaining object identity is an essential feature of selective migration. Using Stsadm.exe and Sites Web service have other limitations as well.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Consequently, content migration scenarios that require you to export only selected content, or that require you to automate or customize migration operations, there is only one approach: you must write a custom solution that uses the APIs in the Microsoft.SharePoint.Deployment namespace.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=AlertText style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN class=LabelEmbedded&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Selective migration operates when there is an established source and a recognized destination for a known quantity of content. That is, selective migration requires that a full migration was initially performed so that the destination is a mirror image of the source.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;Selective migration applies, typically, to content that needs to be migrated from server to server based on factors such as content version (current vs. future), time stamp, and content state (approved vs. in review, for example). Selection criteria provides a high degree of granularity from the scope of the site collection down; that is, you have selection control at the scope of the Web, the list, folder, and list item. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;You can have any number of .cmp files in a migration operation, and you can also have multiple destinations. However, the objects contained in a given content migration package (.cmp) file must originate from a single site collection.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;STRONG&gt;Typical Migration Scenarios&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;
&lt;P class=MsoNormal style="MARGIN: 3pt 0in"&gt;The APIs in the &lt;SPAN class=LanguageKeyword&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;STRONG&gt;Microsoft.SharePoint.Deployment&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; namespace provide a rich migration toolbox that gives you an enormous degree of flexibility to support wide ranging migration scenarios. Following is a list of migration and deployment features that are supported in Windows SharePoint Services 3.0. This list is only a high-level, generalized summary of supported migration scenarios. The Deployment APIs are sufficiently rich to support any number of special circumstances that you might face.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Export an entire site collection (that is, do a full migration).&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Export a specific site inside a site collection, including or excluding content in subsites as needed. The deployment APIs allow you to include or exclude dependencies.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Export a SharePoint list or document library, or even of a specific folder inside a document library.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Export a single list item or document from a document library. This provides the extreme migration granularity that enables so much flexibility.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Export object dependencies like images or attached files.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Generate your export file as a compressed export (.cmp) package, or as uncompressed files.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Throttle exports by specifying a maximum size for the compressed export package file (multiple export files will be created if required).&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Support incremental exports of items that are selected for export based on change tokens. This allows you to automate exporting all items that have been created, changed, or deleted after the timestamp specified in the change token.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Import the exported content with or without preserving object identity—that is, you can configure objects in the export package to retain their object GUID. This is a requirement for selective migrations.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Import the migration content under the same or a different parent in the destination content database. Moving items to a different position in the site hierarchy is an operation is known as reparenting.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;Do link fixup during import.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In my next post we'll continue with this high-altitude look at the subject of content migration. There, we'll talk extensively about key concepts in the migration/deployment feature area.&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6620613" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/migration/default.aspx">migration</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/content+migration/default.aspx">content migration</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/deployment/default.aspx">deployment</category><category domain="http://blogs.msdn.com/sharepointdeveloperdocs/archive/tags/Deployment+namespace/default.aspx">Deployment namespace</category></item></channel></rss>