Recovering site collection from database backup with STSADM

December 13, 2007

Mauro Cardareli posted a cool way to recover a deleted site collection using STSADM.exe with addcontentdb operation. This operation was added in WSS v3 version of STSADM to help in upgrade scenarios (reattaching WSS v2 databases for upgrade) and to create brand new empty content database from command line. Nice side effect is that you can use it to attach previous version of an existing content database, and it will “move” all your site collections there.

Be careful, though: by doing this, you are reverting all site collections hosted in this database to the last good backup state. This means if you any site collections there except the one deleted, odds are some changes will be lost for other sites.

By the way, you can mitigate this risk, by using third-party tools that allow granular SharePoint restore from full SQL backup. (Usual discloser here: I work for Quest and this is one of the products I work on.) One of the beauties of this solution is you can retrieve only the objects you want from a content database backup, even if the backup was created before you install the tool.

Technorati Tags:
, , , ,

Advertisements

2 Responses to “Recovering site collection from database backup with STSADM”

  1. isaac g Says:

    actually if you call this command and use the specific site collection url instead of the whole web app, you can restore that single site collection with the restored content db, and leave all your other site collections intact with the existing content db and won’t lose any changes in them.


  2. Isaac, I am pretty sure you can only point this to a web app. The operation is to add the content db as a whole as described here http://technet.microsoft.com/en-us/library/cc263422(office.12).aspx

    This is different from stsadm site collection backup, where you can backup and restore individual site collection without impacting other site collections.

    I will test though.


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 )

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

%d bloggers like this: