Geeks With Blogs

Questions Answered
Articles Written
Overall Points

Tray on the Web The Ramblings of an IIS/SharePoint Admin, Music Lover, and Margarita Connoisseur

Occasionally you’ll need to restore content databases in SharePoint, whether to recover some lost data or refresh a dev/test environment.  Here are the steps needed in order to access the new data:

  • Determine which database contains the site collection you need to restore.  You can find this by going to Central Administration—>Application Management—>Site Collection List.  Choose the appropriate web application from the dropdown, and click on the site collection that you’re working with. 


  • Restore your database within SQL.  If restoring to the same environment, overwrite the existing database.  If restoring to a different farm, restore it with the same name of the database you’ll be replacing.  If you are restoring to a different farm, make sure the proper service accounts have rights to the database.  At minimum the farm admin account will need to be assigned the dbcreator and securityadmin roles within SQL.
  • Once the database has been restored, you’ll then need to use stsadm –deletecontentdb in order to detach the old database from the site collection.  The command needs to be in the following format: stsadm –o deletecontentdb –url http://websitename/sitecollection –databasename <ContentDBName>


  • Now you’ll need to use –addcontentDB to attach the restored DB to the site collection using the following format: stsadm –o addcontentdb –url http://websitename/sitecollection –databasename <ContentDBName> –databaseserver  <SQLServerName>


  • You should now be able to access the site collection with the updated content database from a browser.


Posted on Tuesday, February 23, 2010 1:27 PM | Back to top

Comments on this post: How to Connect to a Restored Content Database in SharePoint

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Tray Harrison | Powered by: