Thursday, January 20, 2005

SharePoint recovery. The Hard Way

I'm in the process of learning how to use Windows Movie Maker. My Grandfather is turning 80 this February, and we're throwing him a big party. I own getting family pictures together into a 1/2 hour show and displaying them at the party. How does this relate to SharePoint? Well, I only have pictures for the parts of the family that I see regularly.

I sent out the email to the family members to log into my sharepoint site and upload pictures so I can put them into the slideshow.

Being the computer wiz I am, while I was trying to figure out where to tell people to put the pictures, I ended up deleting the biggest document library! Lucky for me, I followed the steps on how to backup SharePoint in the Backing up and Restoring Small Business Server. These steps are also in the on-the-box help in the Backup Snap-in.

However, a few months back, I wasn't that smart, I lost my entire SharePoint site. (they say you always backup after you've had a disaster... well, chalk me up for that). Fortunately, I had been running SBS Backup, so my SharePoint database was stored in MSDE format contained within the backup! Could I use this flat file to recover my SharePoint site?

Sorta. :)

I was able to get the site up and running on a 2nd SBS box, to the point that I could get to the site via the \\unc path to get the files out of. Apparently the site wouldn't load because it couldn't find one of my plug-ins that I had installed.

Here are the steps that I followed:

  1. Un-install the SharePoint MSDE instance

  2. Rename the data directory for the original SharePoint database (%program files%\microsoft sql server\mssql$sharepoint\data) to something else

  3. Re-install the Intranet component again using the maintenance mode of SBS Setup

  4. Unextend the virtual server, using the command stsadm.exe -o unextenddvs -url http://companyweb

  5. From the command prompt, use OSQL commands to detach the newly created database:

    • osql -E -S {servername}\SharePoint

    • sp_detach_db 'STS_Config'

    • sp_detach_db 'STS_ServerName_1'

  6. then use similar commands to attach the old databases from the backup:

    • osql -E -S {servername}\SharePoint

    • sp_attach_db 'STS_Config', '{path to old databases}\STS_Config.mdf', {path to old databases}\STS_Config.log.ldf'

    • sp_attach_db 'STS_ServerName_1', '{path to old databases}\STS_ServerName_1.mdf', {path to old databases}\STS_ServerName_1_log.ldf'

  7. Extend the virtual Server using the command: stsadm.exe -o extendvsinwebfarm -url http://companyweb vsname companyweb

While I've not successfully gotten these proceedures to work to actually open up http://companyweb because my site had a web-part (which I couldn't re-find again). The webpart wouldn't load (since I believe it wasn't installed on the server), so the whole SharePoint site wouldn't load. Luckly I could browse to \\companyweb and access the files that way, extract all the files out and import them into the new SharePoint site.


BriaMonte said...

This is probably easier! Backup Manager for SharePoint.

Anonymous said...

Surely, SharePoint disaster recovery is one such problem which sharepoint admin never wants to face.

But as we say, thers an action for every reaction, disasters come hand to hand when server goes down, backups turn bad or the databases become corrupt. In such situations one can implement built-in techniques of sharepoint document recovery or can go for a sharepoint recovery software. One such tool is from

it restores and recovers from sharepoint mdf databases..

Tanvi Sharma said...

SharePoint Recovery is easy to do if we have updated backup but in case of no backup it is really difficult. SharePoint Recovery Software helps in such cases.Check this software to recover your corrupt SharePoint Database: