Attach databases and upgrade to SharePoint Server 2010

How to detach SharePoint 2007 database and attach to SharePoint 2010 farm?
In this post, I am going to provide all the steps you needed to attach SharePoint 2007 database to SharePoint 2010 database.

1. Go to Central Administration of your SharePoint 2007 farm
Application Management > Content Database

In this example,  I created a new site with separate database called  SP2007_content_DB in SharePoint 2007 and going to
move this database to SharePoint 2010


Database for above site



2. Next we are going to open SQL Server Management Studio and take full back up of SP2007_content_db


3. Before you backup your database set the database to read-only so that no changes happen to your current database

Setup database read-only


4. Perform full back of your database


5. Take your backup and move to your SharePoint 2010 environment and open SQL Server 2008 Management Studio
– Restore SharePoint 2007 database which you back up

Restore databae in SQL Server 2008

SharePoint 2007 database is restored to SQL Server 2008 in SharePoint 2010 environment


6. Current SharePoint 2010 Site


7. open SharePoint 2010 Central Administration to unlick current content database
Central Administration > Application Management > Manage Content Databases

Manage Content Database in SharePoint 2010

8. Click on database and scroll down where it says remove content database

Remove Content Database ( removing content database is not deleting a database)
Use this section to remove a content database from the server farm. When you select the Remove content database check box and click OK, the database is no longer associated with this Web application. Caution: When you remove the content database, any sites listed in that content database are removed from the server farm, but the site data remains in the database.

remove content database from SharePoint 2010

Click OK to remove the database

removed content database from SharePoint 2010


9. Next open SharePoint 2010 Management Shell and test your database

test-spcontentdatabase –name –YourDatabaseName –webapplicaiton YourSiteName

test-spcontentdatabase –name –sp2007_content_db –webapplicaiton http://YourSite


Since I don`t have any Upgrade Blocking, I am good to go and mount the database

mount-spcontentdatabase name sp2007_content_db –databaseserver SQLServerName –webapplication  http://YourSite


Mounting database to SharePoint 2010 completed

mount-spcontentdatabase completes


10. Now go back to Central Administration > Application Management > Manage Content Databases and refresh.
You should see your new database which you mounted

Mounted Database in SharePoint 2010


11. Let`s open SharePoint 2010 site and see the contents which we moved to SharePoint 2010.


The reason I am not able to see any content because of the message which I got in step 9



In my next blog, I am going to speak about how you can fix above error messages.

Published by Aryan Nava

Founder of "BlockchainMind", CTO for two Blockchain startup during 2018, Cloud/DevOps Consultant and Blockchain Trainer

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: