In part 1 of this two-part series I talked about the new Alternate Access Mapping functionality in SharePoint 2010 and how it can be used to implement gradual upgrade at the site collection level. In this part I'll walk you through the process step by step.
I'm going to move my SharePoint 2007 web application to a new SharePoint 2010 server. The original web app is can be found here. There are 3 content databases attached to it, each hosting one site collection:
Before proceeding, I update my SharePoint 2007 farm to SP2 plus at least the October CU to get the latest pre-upgrade checker in stsadm and scan my farm for inconsistencies and potential blocking issues.
Create SharePoint 2010 Web Application
First off, I need to create a new SharePoint 2010 web application to host my upgraded sites:
Note that I use my existing URL. Make sure the web app settings are the same as the original web app. If you have custom managed paths in use, add those to the 2010 web application before upgrade as well. If a request for a non-existing managed path comes in, SharePoint 2010 will reject it instead of redirecting to 2007.
You may want to delete the default content database that is provisioned with your 2010 web app.
You can also choose to upgrade your databases on a temporary web application on the same or a different 2010 server and reattach them to the production web app when done. This way you can prevent users from getting 'Server Error' when they try to access a site collection that is in the process of being upgraded.
Set Up Redirection in SharePoint 2010
Now I need to configure my SharePoint 2010 web application to redirect requests for site collections pending upgrade.
I'll use stsadm -o addzoneurl to add a redirection URL of http://portal-old to the Default zone of my 2010 web application (note the new Redirection URL parameter):
The redirection URL is not visible from the AAM management UI of Central Administration. To see if you have redirection in place, you should use the stsadm -o enumalternatedomains op (look for <RedirectURL>):
Move Original Web App to Redirected URL
I need to reconfigure my source SharePoint 2007 web application to respond to a temporary URL (http://portal-old) that my target 2010 web appication will redirect users to.
To do that I'll need to un-extend the web application first:
Then re-extend to bind it to the redirected URL:
Remap DNS Entries
When everything's ready, I point my existing portal resource record to the SharePoint 2010 server and add a new portal-old entry for the existing web app and point it to my SharePoint 2007 server.
If you have a software or hardware load-balancer between users and your SharePoint front-ends, you will need to reconfigure it as well.
Now I have my redirection up and running - requests for http://portal or http://portal/sites/one are redirected to http://portal-old and http://portal-old/sites/one respectively. Time for some upgrade fun!
Set Source Databases Read-Only
To prevent my users from changing sites while I'm upgrading them to the new version, I'll use SQL Server Management Studio to set my original databases read-only before proceeding with upgrade:
SharePoint promotes the db read-only status to all site collections in it and the UI is automatically trimmed to reflect that:
Upgrade Root Database
While generally the order in which you upgrade databases does not matter, you have to upgrade the database that hosts the root site collection first. The reason according to the white paper is to "ensure that any references to root-level resources, such as _vti_bin or _layouts, will not be redirected; if these references are redirected, the resources will fail to render upgraded content correctly."
So I go ahead and back up my root database (Portal_Content_1), restore it from backup to a new database (Portal_New_1).
Next I want to make sure it is upgradable using the Test_SPContentDatabase PowerShell cmdlet against the unattached db:
So I have a couple of references to missing web part configuration files, but none will block my upgrade (UpgradeBlocking: False). So I start it by attaching the database to my SharePoint 2010 web app:
Upgrade Other Databases
I can do them one by one, but to speed it up a bit I'll use parallel upgrade with 2 simultaneous upgrade sessions:
While databases are being upgraded, I can use Check Upgrade Status in Central Administration to check the progress:
As site collections are upgraded and connected to the new web application, SharePoint 2010 stops referring users to a SharePoint 2007 copy of the site and serves content locally.
Upgrade Site Visuals
By default, the upgrade process does not upgrade sites to the new SharePoint 2010 visuals. So a visitor of the upgraded portal site won't see much difference when he hits the site:
Let's flip the switch using visual upgrade (Site Actions > Visual Upgrade):
You can also use a simple PowerShell script to upgrade all the site collections in a database in a single move. See Todd Klindt's post for details.
Turn Redirection Off
Now that all my sites are upgraded, I can remove redirection by running stsadm -o addzoneurl once again, this time without the RedirectionURL parameter:
Database upgrade with AAM URL redirection is the ultimate technique for downtime mitigation for large-scale SharePoint upgrade projects. IT pros should definitely consider it in their SharePoint 2010 upgrade planning to see if the benefits it offers outweigh the administrative and operational efforts to implement it. Even from this overly simplified example you can see that using redirection involves some serious planning and well-coordinated execution. In reality you may have to deal with web applications extended into multiple zones, client applications that cannot handle client-side redirections, URL proliferation, etc. Make sure you take these into consideration and test the process in a non-production environment.
Sean Livingston's white paper on using AAM redirection
SharePoint Joel's: SharePoint 2010 Upgrade Insight Series