Wednesday, July 20, 2011

[SP2010] Upgrade SharePoint 2007 content to SharePoint 2010 via the Database Attach method

Last week I performed an upgrade of SharePoint 2007 to SharePoint 2010 using the Database Attach method. Unfortunately the database upgrade "Completed with errors". However, the site collections were available in SP2010 without errors. Also changing the visual style to SP2010 worked just fine. Detaching the database and reattaching did not give me any error, but it didn't restart or continue the upgrade process. Then how to fix this:

Troubleshoot upgrade errors
Each upgrade process produces an upgrade log file, which displays each error and warning that is found during the upgrade. To successfully complete the upgrade process you will have to fix each error and restart the upgrade process to upgrade the remaining, not yet upgraded, site collections.

Restart/resume the database upgrade
Once you have fixed all upgrade issues, you have to restart the upgrade process. This can be done using the following PowerShell script:

$guid = Get-SPContentDatabase -Identity <dbname>
upgrade-spcontentdatabase -id $guid

However if the database still contains issues, the upgrade will fail again. Review the generated log file to check what the errors are and retrieve more info for troubleshooting.

Verify upgrade status
To verify if all components in the environment are upgraded successfully, run the following command:
stsadm -o localupgradestatus

This command generates a report that contains a summary at the bottom. The part marked bold is the important part and specifies that in all databases there are 16 site collections not upgraded yet, this number should be zero.
[9] content database(s) encountered.
[0] content database(s) still need upgrade or cannot be upgraded.
[43] site collection(s) are contained in the content databases.
[16] site collection(s) still need upgrade.
[82] other objects encountered, [0] of them still need upgrade or cannot be upgraded.

If you send the output of the command to file and search for the text "Needs Upgrade", you will find the site collections that aren’t upgraded yet:
    <status>Needs Upgrade</status>

Monday, July 04, 2011