Tuesday, June 22, 2010

SharePoint 2010 Granular Backup and Restore - Recovering Data from an Unattached Content Database

he built-in backup tool in SharePoint 2010 accommodates backing up the following:

• Back up a farm
• Back up a farm configuration
• Copy configuration settings from one farm to another
• Back up a Web application
• Back up a service application
• Back up search
• Back up the Secure Store service
• Back up a content database
• Back up databases to snapshots
• Back up customizations
• Back up a site collection
• Export a site, list, or document library
• Back up or archive logs

See here for more detail: http://technet.microsoft.com/en-us/library/ee428315.aspx

Sounds pretty good right? What if you have a user who deleted a list, library or even an individual document? If it's not sitting in the recycle bin for the site collection, then what?

The answer is a new feature called granular restore which gives you one more option to use before you have to go to an expensive third party backup and restore solution. The only catch is that you have to have a SQL backup of the content database in question that you can mount in SQL using SQL Management Studio. To be safe, I use the built-in SharePoint 2010 backup tool to run farm backups (How to Automate SharePoint 2010 Farm Backups), but I also do regular SQL backups. In the event of some type of disaster, I've given myself a few options for doing a restore.

Step 1

In SQL highlight the content database you want to restore, right-click it and select Tasks - Restore -Database. In the "To Database" field, type a name for the new database (ex: DatabaseName_restore). Specify the point in time you want to do the restore from.

Step 2

Go into Central Admin on the SharePoint server and select Backup and Restore - Recover data from an unattached content database. Specify the SQL server and database name you created above during the restore. Select Browse Content and hit next.


Step 3

Select the site collection, site, and list or library you want to restore. Specify that you want to export the selected content, and specify a location for the file. I find the best way to locate the library, list, etc that I want to restore is to use the Search field that's presented to you.
When you hit Next, you'll be prompted for the location you want to export the site to. I just use a local folder. Next, hit Start Export.
Step 4

Now that you exported the data from the restored database, you can import the data into the production site to restore the missing list, library, document, etc.

Open SharePoint PowerShell while logged in as Farm Admin and run the Import-SPWeb command to specify the identity of the web you're working with, and the path to the restore file you created above:

Note that you specify the root web, and it will restore the data you specified when you browsed the restored database to its original location. To learn more about what options are available when importing data visit http://technet.microsoft.com/en-us/library/ff607613.aspx.

3 comments:

Anonymous said...

Does anyone know if this will work for files stored with RBS using the Filestream provider?

Recover Deleted Files said...

Restoring data from failed SharePoint server is not an easy task. A third party SharePoint database recovery software may help the users to get upto 100 % data in such type situations. One of the best and globally used application can be downloaded from here:

http://www.recoverydeletedfiles.com/sharepoint-server-data-recovery.html

Anonymous said...

To fix corruption issue in SharePoint and to retrieve your all information from corrupt MDF database. You can make use of third party tool http://www.en.sharepointdisasterrecovery.net It is much capable of restoring your all data from corrupt or damaged SharePoint database with full accuracy.