Copying SharePoint 2010 Site Collection from Production into DTS environment via Database back up and restore
If you are running SharePoint farms then you would have come across this requirement at least once, which is to replicate a production site or site collection into Development, Test or Staging environment. There are a number of blog posts and articles on how to copy down the site or site collection without much trouble but I have not found one which worked as expected.
The Database back-up and restore method is a quick and easy method or cheaper solution than commercial tools available in the market. This method works well if you would like to quickly copy content. With the content database attach method the key is to be aware that the following items which are farm related attributes, need attention as they are not copied across. Search scope and Indexes, User accounts and Managed Metadata.
There are easier ways to overcome these. Search scope and indexes have to be redone and it does not take too much of your time. If your DTS environments have different users than the production environment then you may want to recreate the users, assuming you don’t need all production users in your DTS. Managed metadata and term sets can be restored from production if it’s a requirement. I am not going to go into the details of it in this post.
1. My site collection from the source farm looks like the following
2. My content Database is called WSS_Content_bd_074
3. Take a back-up of the content database using the tool you are familiar with. I am going to take the quick and easy way and use SQL Management Studio. Right click on the db and select ‘Task’—> ‘Backup’. Take a full backup and move it to your destination SQL server or mapped drive.
4. Restore the database into your destination database server. Right click on Databases node and select Restore Database ‘Databases’—>’Restore Database’. Select the back up file after selecting Device option. My screen looks like this.
5.Click Ok to restore the database. At this point I have the content Database ready to be attached to the Site Collection in my destination environment.
6. Create a blank site collection. If the site collection in your source environment was deployed through a solution, you should use the same solution to create the blank site. In this example I have manually created an empty site collection and added a blank team site called ‘My Test Team Site’.
7. Now go to Central Administration page for your Farm and click on Manage Content database
8. Select the appropriate web application and click on the content database. My content database is WSS_Content_myteamsite
9. From the next page select Remove content database and ignore the message. Click on ok to detach the content database from your site collection.
10. At this point you have a blank site collection without a content database
11. Now attach the database we restored from the source environment. Click on ‘Add a content database’. Only change you have to make is to change the Database name.
12. I will just type in ‘WSS_Content_bd_074’ and hit OK to attach the content database. Once the this is complete your manage content database screen will look like the following.
If you now go to your new site. In my case it is http://mysite will see the bd-074 site
If you have errors at this stage, you might want to look at the configuration database version and make sure that both farms are patched up to the same level.
One of the common errors has been discussed here. http://sharepoint.stackexchange.com/questions/40523/mount-spcontentdatabase-error
Discussion on how to achieve the same result through PowerShell has been is here http://www.sharepointassist.com/2009/05/30/restoring-a-sharepoint-site-collection-to-a-new-domai/
Hi,
ReplyDeleteIt is very informative and very helpful on my research regarding seo techniques. Thanks for sharing this post.
Authentication Services