I was fairly sure on what I needed to do, but a little fuzzy on the exact procedures. "No problem", I said to myself, "I'll just pull up the documentation from the last time I did this." Oops! Apparently I did not document it last time, or I forgot where I put it, 'cause I couldn't find it anywhere. So this time around I made documentation and figured I would share it with the rest of the world. I'm sure there are other ways to do this, but I went for easy to follow, rather than sophisticated. Enjoy!
Restoring SharePoint Site or Item from Content Database Backup
Precautions
- If an entire site collection is not to be restored, then the content database must be restored to a staging farm.
- The staging farm must be the same version/build as the production farm.
- Any features (.wsp) that are active for the site in question on the production farm must be installed on the staging farm.
Procedure
Restoring a site collection
To restore from a current version/build content db
- Stop the IIS website of the site collection to restore.
- Using SQL Server, set the content database for the site collection into single user mode.
- Restore the content db according to SQL Server db restore practices.
- Restart the IIS website.
To restore from a previous version/build content db
- Stop the IIS website of the site collection to restore.
- Using SharePoint Central Administration remove the content db of the site collection to be restored.
- Using SQL Server, set the content database for the site collection into single user mode.
- Restore the content db according to SQL Server db restore practices.
- Use the stsadm –o addcontentdb command to add the content database to the site collection (stsadm –o addcontentdb –url
-databasename ). Other options may be needed. - Restart the IIS website.
** Please note that it is not required to start and stop the IIS site, but in some cases it is more user-friendly.
Restoring a web (sub web)
- Create an empty site collection on the staging farm (this can be a root or a sub site collection)
- Sub site collections are a little more tricky and may be best created via the stsadm –o createsiteinnewdb command.
- Restore the content db according to SQL Server db restore practices.
- Using SharePoint Central Administration or stsadm, take the current content db for the site collection offline, or remove it.
- Use the stsadm –o addcontentdb command to add the content database to the site collection (stsadm –o addcontentdb –url
-databasename ). Other options may be needed. - Use the stsadm –o export and stsadm –o import commands to export the specific sub web from the staging farm and import it into a specified location on the production farm.
- It may be beneficial to use various options from the export and import commands to preserve security, etc.
- Create an empty site collection on the staging farm (this can be a root or a sub site collection)
- Sub site collections are a little more tricky and may be best created via the stsadm –o createsiteinnewdb command.
- Restore the content db according to SQL Server db restore practices.
- Using SharePoint Central Administration or stsadm, take the current content db for the site collection offline, or remove it.
- Use the stsadm –o addcontentdb command to add the content database to the site collection (stsadm –o addcontentdb –url
-databasename ). Other options may be needed. - Find the item in question and move it to the production farm by whatever action(s) seem prudent.