Attach databases and upgrade to SharePoint Server 2010

November 22, 2011 — Leave a comment

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

image

Database for above site

SNAGHTML15db264

 

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

SNAGHTML163bd2d

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

SNAGHTML18d2c93

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

image

6. Current SharePoint 2010 Site

image

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

test-spcontentdatabase

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

mount-spcontentdatabase

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.

SNAGHTML1c94256

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

SNAGHTML1b2410d

 

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

No Comments

Be the first to start the conversation!

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s