Wednesday 5 June 2013

Recovering from a deleted site collection

Recovering from a deleted site collection

You go to your portal this morning and instead of seeing the home page you are greeted with a ’404′ error page. Something is wrong! You look in Central Administration and you notice that your Web Application is there but the site collection is gone. Ouch! Time to recover…
In this scenario, let’s assume that you have NOT been doing site collection backups but you do have SQL backups. You notice that last night’s content database backup is considerably smaller than the night before (yes, you have been saving multiple days of backups). Phew! Your data is all there; we just need to reconnect it. Here’s how:
1. Create a new database and restore (through SQL Server) the last good database into it
2. At the command prompt, use stsadm command to add the content database to your site
stsadm.exe -o addcontentdb -url <your url> -databasename <content database> -databaseserver <database server name>
3. Run an IISRESET
4. Go to Central Administration and look at the list of content databases for your web application (under Application Management). There should be two (the old one – with zero sites – and the new one just attached). Delete the old database.
5. Done! Go to your URL… all should be good again.

No comments:

Post a Comment