Migrating SharePoint content between different site templates and preserving all the necessary metadata

April 10th, 2009 | Categories: SharePoint

I’ve had a case recently where I needed to migrate a document library that has extra columns, and document versioning enabled. The important issue was to preserve also the document properties like Author, Editor, Created and Modified date.

To make the challenge even tougher, the content needed to be moved between two different site collections and the site templates were different. Source location was a modified meeting workspace, the destination was a customized team site.

Here’s the process that did the trick:

  1. Save the source website like template (don’t include the content – on meeting workspaces you can’t by default)
  2. Copy the website template from source web template gallery (http://sourcesite/_catalogs/wt) to destination site web template gallery (http://destinationsite/_catalogs/wt)
  3. Under the destination web create a subweb from the uploaded template. (for example http://destinationsite/destinationweb/import)
  4. on the server run the stsadm export command to export the complete website. Make sure to include the –includeusersecurity and –versions 4 switch (note the users won’t be able to be copied if both sites don’t use the same credential system (same AD, or computer users). The command is following:
    stsadm -o export -url http://sourcesite/sourceweb -filename migrate.dat -includeusersecurity -versions 4 -nologfile -cabsize 1023
  5. still on the server run the stsadm import command to import the migrated data to newly created site. Make sure to include –includeusersecurity and –updateversions 1 or –updateversions 2 switch. The command is following:
    stsadm -o import –url http://destinationsite/destinationweb/import -filename migrate.dat –nologfile -includeusersecurity -updateversions 2
  6. open the imported site in browser and save the document library that needs to be migrated like a template (don’t include content)
  7. in the destination web create the document library from the template. Now you have exactly the same columns as the source library.
  8. Using the Site content and structure manager (http://destinationsite/_layouts/sitemanager.aspx) move the documents from import site/document library to destinationweb/document library
Technorati Tags: ,