Thursday, April 1, 2010

SharePoint 2007 Farm Migration

As part of the company acquisition and platform enhancement, recently we have been tasked to perform a migration from an old SharePoint 2007 farm (running on old company domain) to a new SharePoint 2007 farm (running on new company domain).  The old SharePoint farm has one root site collection with fourteen sites, stored in one big content database.  On the new SharePoint farm, these fourteen sites will be created as site collections with their own content databases in order to ensure enhanced operation procedures.  The new farm topology consists of one web front-end server, one index server and one database server.  There is also a recovery farm in a standalone server and a DPM 2007 server for backup and restore purpose.  The migration was performed by using the stsadm command line tool.

The steps taken during the preparation of the migration process are below:
1. Setup and configure the new SharePoint farm
2. Deploy non out of the box site templates if any (e.g. F40 application templates) in the new farm
3. Create staging web application in the new farm
4. Create destination web application in the new farm

The steps taken during the actual migration process are below:
1. Set the root site collection in the old farm to read only mode to prevent any new updates
    stsadm -o setsitelock -url {root_site_collection_url} -lock readonly
2. Copy the content database backup file of the old farm to the new farm's database server and restore it
3. Attach the restored content database to the staging web application in the new farm
    stsadm -o addcontentdb -url {web_application_url} -databasename {database_name}
4. Export the fourteen sites of the root site collection in the staging web application to files in the file system
    stsadm -o export -url {site_url} -filename {file_path_and_name} -overwrite -includeusersecurity -versions 4 -cabsize 100

Notes:
includeusersecurity: preserves the user security settings
versions: indicates which type of file and list item version history should be included in the export. If the -versions parameter is absent, the export operation will default to using a value of 1.
1: Last major version for files and list items(default)
2: The current version, either the last major or the last minor
3: Last major and last minor version for files and list items
4: All versions for files and list items
cabsize: An integer from 1 to 1024 megabytes that describes how large each cabinet file (*.cab) should be. Once the specified size is reached, another cabinet file is generated. This can be beneficial if you are copying files over a network, and you want the file size to be small.

For example:
5. Create fourteen new site collections with their own dedicated content databases using Blank site template in the new farm
    stsadm -o createsiteinnewdb -url {site_collection_url} -ownerlogin {owner_login_id} -ownername {owner_name} -owneremail {owner_email} -sitetemplate "STS#1" - title {site_collection_title} -description {site_collection_description} -quota {quota_template} -databasename {database_name} -databaseserver {database_instance_name}

For example:
  • stsadm -o createsiteinnewdb -url http://newportal.contoso.com/sites/Marketing -ownerlogin "contoso\davidlim" -ownername "Lim, David" -owneremail "davidlim@contoso.com" -sitetemplate "STS#1" -title "Marketing Site" -description "Contoso Marketing Site" -quota "Contoso Quota" -databasename "Contoso_Content_Marketing" -databaseserver "CONTOSOSQL"
  • stsadm -o createsiteinnewdb -url http://newportal.contoso.com/sites/Sales -ownerlogin "contoso\davidlim" -ownername "Lim, David" -owneremail "davidlim@contoso.com" -sitetemplate "STS#1" -title "Sales Site" -description "Contoso Sales Site" -quota "Contoso Quota" -databasename "Contoso_Content_Sales" -databaseserver "CONTOSOSQL"
6. Import the exported fourteen site files into their coresponding site collections in the new farm
    stsadm -o import -url {site_collection_url} -filename {file_path_and name} -includeusersecurity -updateversions 2

Notes:
updateversions: indicates how to resolve situations where a file to be imported to a site already exists in that site. If the -updateversions parameter is absent, the import operation will default to using a value of 1
1: Add new versions to the current file (default)
2: Overwrite the file and all of its versions (delete then insert)
3: Ignore the file if it exists on the destination

For example:
7. Delete the staging web application in the new farm, including its IIS web site and content database

2 comments:

  1. Nice, article. Knowing about setsitelock was interesting. Can you add some more details for configuration database as well? We followed MS guidelines but WFE cache is out of synch

    ReplyDelete
  2. I absolutely love your blog and find nearly all of your post’s to be precisely what I’m looking for.
    SharePoint 2013 Administration training Online

    ReplyDelete