Tallan Blog

Tallan’s Experts Share Their Knowledge on Technology, Trends and Solutions to Business Challenges

Upgrading a SharePoint 2007 Content Database to SharePoint 2010

Before You Read

Microsoft supports various upgrade paths from WSS3.0/MOSS 2007 to SharePoint 2010.  This post will highlight the “attach and upgrade” approach.

Upgrade Steps

Run the Pre-Upgrade Check on the SharePoint 2007 Server

Execute the following command from the command line on the SharePoint 2007 server hosting the database to be upgraded:

stsadm –o preupgradecheck

This will scan the server for potential problems that may cause errors during the upgrade process.


Review the log file to get specifics on any issues.  The most likely cause will be features or customizations, so make sure that you uninstall any features or customizations that aren’t necessary on the new server.

Back Up Your 2007 Content Database

Back up your 2007 content database from SQL Management Studio on the SharePoint 2007 server, and put the backup file somewhere it is accessible from the new SharePoint 2010 Server instance.


Restore the 2007 Content Database to the SharePoint 2010 Database Instance

Connect to the SQL Server Instance hosting your SharePoint 2010 installation’s databases.  Restore the legacy content database from the backup file created in the step above.


Create a New SharePoint Web Application

Note:  If you have a Web Application created that you plan on using, skip this step and move onto the next step, “Detatch Any Content Databases from the Target Web Application”.

In Central Administration, select “Application Management” from the left navigation pane, and Manage Web Applications under the Web Applications heading.

Click the “New” button on the ribbon toolbar.


Under the “Database Name and Authentication” section, add “DELETETHIS” or something similar to the end of the database name to differentiate it.  We will be removing and deleting the generated content database.


Once completed, you should see the following success dialog:



Detatch Any Content Databases from the Target Web Application

In Central Administration –> Application Management, select “Manage Content Databases” under the Database heading.

Select the target web application in the “Web Application” drop-down box at the top left, if it is not already selected.


Ensure there are no content databases for the target web application.  If the list contains any content databases, click on each content database name.  On the “Manage Content Database Settings” screen, select the “remove content database” checkbox and click OK.


Note: Make sure to log into your SharePoint 2010 SQL Server Instance at your convenience and delete any orphaned content databases that were removed from the web application in the step above.

Run The Powershell Test-SPContentDatabase Cmdlet

Launch the SharePoint 2010 Management Shell available under Start->Programs –> Microsoft SharePoint 2010 Products.  (Note: If running on a development/client instance on Windows 7 x64, ensure you launch the management console with administrative privileges by right clicking the icon and selecting “Run as administrator”).

Run the Test-SPContentDatabase command from the SharePoint 2010 Management Shell PowerShell window with the following syntax:

Test-SPContentDatabase –Name [DBName] –WebApplication [URL]


This tool will scan your Content DB and search for any references to Web Parts or Features that are missing on your SharePoint 2010 installation.  Each error will indicate whether or not it will block the upgrade, and gives a useful remedy for each issue.

Any issues not marked as Upgrade Blocking can be resolve post-upgrade.


Restore the Content Database Using STSADM.EXE

Using the stsadm.exe tool, run the addcontentdb command using the syntax below:

stsadm –o addcontentdb –url [URL] –databasename [DBName]


Once executed, the command window will update with a progress indicator as seen in the screenshot above.  Once it is complete, you will either receive one of two messages:

Operation Completed Successfully


Upgrade completed with errors.  Review the upgrade log file located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\Upgrade-[DateStamp]-[ids].log.  The number of errors and warnings is listed at the end of the upgrade log file.

You can also review the upgrade status in the Central Administration web application under Upgrade and Migration –> Check Upgrade Status.


This report contains the location of the log file for the upgrade process for future reference.

Review any upgrade errors and resolve before moving forward.

Accessing the Upgraded Site and Visual Upgrade

Accessing the Upgraded Site

Open a new web browser instance and navigate to the URL for the web application you upgraded.


You will notice the site retains the same SharePoint 2007 look and feel.  This was done deliberately to allow upgrading to SharePoint 2010 without introducing drastic interface changes to the client base.

Optional: Visual Upgrade

SharePoint 2010 offers a simple method for upgrading the existing site to the new SharePoint 2010 look-and-feel.

From the Site Actions menu at the top left, click “Visual Upgrade”.


From the “Site Settings –> Title Description and Icon” page, enter any site metadata you want to upgrade, and click the “Update the User Interface” radio button under the “Visual Upgrade” section as seen below.  Click “OK”.


You will now be returned back to your site’s main page with the updated SharePoint 2010 look-and-feel.




Learn more about Tallan or see us in person at one of our many Events!

Share this post:

10 Comments. Leave new


I tried to mount the database but it is showing an error that the database server is an accesible.

Does it has something to do with the rights given to the user or something else has to be done.

Michael Gerety
April 21, 2011 12:19 pm

I’d need more specifics. Where did you get this error? In SQL Management Studio? In the command prompt? What exactly was the error?

while i tried to test the webapplication as given above through management shell it is not able to locate the database. thats where the arror is coming.

i an trying to attach content database to a web applicationbut due to site orphans the upgrade is failing. i have tried to detach and attach the content database but it is not helping.

How do i remove the site orphans when i dont have any idea of there location.

Michael Gerety
April 26, 2011 12:20 pm

it’s going to be very difficult for me to help you resolve this issue without more information. If you’d like, you can e-mail me at Michael [dot] Gerety [at] tallan.com . Try to include screenshots, detailed steps leading up to your error, and some more context around exactly what you’re doing and I’ll do my best to help.

Okay i have done the upgrading part juz made some few mistakes.Your blog cleard that part for me. But could you help me with how to change the location of the top navigation menu. It is placed at the top left corner of the team site but if i want to change its location to top right hand corner just around the login field.

How can i do that.

Now i’m doing the upgrading , i hope everything will be ok , cause i saw that someone made some mistakes and i really need to do it without any. The webapplication works without any error on my friends computers, so it should work on mine too.

How do you migrate the users in this scenario, if you have different rights on different users on the old SP?

did you have to copy the v4.master template to all of your sites and subsites? And did some of your site not have the option for Visual Upgrade?

I have several errors when migrating a content database to 2010:

Database contains a site (Id = ., Url = .) that is not found in the site map. Consider detach and reattach the database.
The orphaned sites could cause upgrade failures. Try detach and reattach the database which contains the orphaned sites. Restart upgrade if necessary.
Database contains a site (Id = ., Url = .) whose url is already used by a different site, in database (Id = [.-.-.-.-.], name = [.]), in the same web application. Consider deleting one of the sites which have conflicting urls.
The orphaned sites could cause upgrade failures. Try detach and reattach the database which contains the orphaned sites. Restart upgrade if necessary.
One or more setup files are referenced in the database [.], but are not installed on the current farm. Please install any feature or solution which contains these files.
Template MPS#0: SPSite Id=bcb4ff41-ca72-4738-84d1-a7d83767ca35 could not be accessed due to exception. Skipping SPWeb Id=. for template upgrade. Exception: System.IO.FileNotFoundException: The site with the id . could not be found.

Any help would be great

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>