Thursday, October 9, 2008

Migrations, Site Definitions, and MergeContentDBs

When migrating from SPS 2003 to MOSS 2007 we all know there are 3 options to pick from;
In-Place (Quickest, most room for error)
Gradual and (Ease of use and control)
Database (More manual, ease of use, leaves old farm completely in tact)

For all intents and purposes this post will summarize a Database Migration and Resetting Site Definitions, but the focus is primarily on the stsadm command mergecontentdbs and how I used it to restore multiple site collections at once rather than using backup and restore.

Here's what I did:

Backup and Restore (from SPS 2003 to Development MOSS 2007)
  • Put Content DB's in Read Only Mode
  • Run Pre-Upgrade Scan
  • Reset to original Site Definition
  • Backup Content DB's
  • Transfer .bak files to Development
  • Restore DB's in Development SQL Environment

Upgrade and UAT (In Development MOSS 2007)

  • Attach newly upgraded datbase(s) as new content database(s)
  • Upgrade Process (Automatic)
  • User Acceptance Testing

Restore (to Production MOSS 2007)

Once sites have passed UAT and all functionality can be accounted for, sites will be “merged,” or moved to a new content database that is ready to be attached in the production environment. The new database will be backed up and then restored as an entire collection. With this method we can move multiple sites at once rather than manually moving each site collection one by one. The following command line prompt is an example of merging content databases;

First, the option that I will be showing here (#3) requires a file to read from. That file is a list of the sites in the database that you want to move to another one. This list can be edited to exclude certain sites. In our case excluding sites that haven't passed UAT.

Example;

stsadm -o enumsites -url http://sharepoint/ -databasename Content_DB1 > c:\mergesites.txt

Second, perform the mergecontentdbs command.

stsadm -o mergecontentdbs
-url
-sourcedatabasename
-destinationdatabasename
[-operation] {1-3}
1 - Analyze (default)
2 - Full database merge
3 - Read from file
[-filename]

Example;

stsadm -o mergecontentdbs -url http://sharepoint/ -sourcedatabasename Old_DB1 -destinationdatabasename New_DB1 -operation 3 -filename c:\mergesites.txt

The new content database will be restored to the Production SQL Environment and will then be attached to the SharePoint Farm.

  • Restore new merged and backed up database to Production SQL Environment
  • Add New Content Database in Production SharePoint Farm

-Brian Grabowski

No comments: