Restore Site collection and Managed Metadata from Production farm to Development farm in Sharepoint 2010

Once you have Sharepoint Site up and running in Production Environment sometime you would like to have copy of that Site on Development environment for reason likes Production content to test against your custom development.We had same task to copy production site to development and we also have managed metadata service  running on  production environment so also want to copy that as well.
Before i dive into steps thing to check up front make sure both farms have version of Configuration database and also install third Party Controls like Telerik if you are using one on development environment.

Summary of Steps that i have followed to achieve this task
1.Take Backup of Production Site using Sql Server Tools
Login to SqlServer and then right Click on Content Database of Production Site Select Tasks –> Backup and save it on some Shared.
2.Take Backup of Database of Managed Metadata if you have one otherwise skip this step.
3. Restore Content Database and Managed Metadata database on Development SqlServer
Login to Dev SqlServer and Create Database for Dev Site and make Sure dbo is your development farm account domain\farmaccountName.
Restore Production Content Database to this newly created database by right Click on Database Select Task–>Restore
Grant db_owner role to application pool identity which is you going to user to Create Web Application on farm lets say domain\appidentity by using following script

 EXEC sp_addrolemember 'db_owner', 'domain\appidentity' 

Grant db_owner role to Account Configure for Search Crawl if you are using Search.
Now Expand Security Node Under Content Database and Verify that under Users you have ‘dbo’,’domain\appidentity’ users.
Double Click on ‘dbo’ and Verify loginName is your farm account for example domain\farmaccountName.
4.Restore Managed Metadata Database.
If you have Configure Managed Metadata Service you will have Database for that so restore Prod DB on this Database.
Grant db_owner role to application pool identity which is used to configure Managed Metadata Service lets say domain\appService by using following script

 EXEC sp_addrolemember 'db_owner', 'domain\appService' 

Now Expand Security Node Under Managed Metadata Database and Verify that under Users you have ‘dbo’,’domain\appService’ users.
Double Click on ‘dbo’ and Verify loginName is your farm account for example domain\farmaccountName.
5.Now Create a WebApplication on Development Server using Application Pool account which identity is domain\appidentity
6.Now Deploy all your Custom Solutions means .wsp to Development farm.
7.From Central Administration, Select Application Management and then under Databases section Click Manage content databases.
8.Select Previously Created WebApplication and Delete Content Database by Clicking On Content DB name and Check Remove Content Database.
9.Now Add Previously restored Content Database by Clicking on Add Content Database.
That’s it.This should work if you get it right.It worked like charm in my case as i have restored Entire SiteCollection from http://www.music.udel.edu to wwwtest.music.udel.edu
10.If you have different Domain Controller then from Central Administration,Select Application Management and under Site Collection Section Click on Change site collection administrators and change site collection administration.
Credit goes to Andrew Connell
Hope this will help someone out there.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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