Restore detached content DB list data to another SP 2010 instance

Restore detached content DB list data to another SP 2010 instance

Had quite a scare today, when one of our business users asked why he couldn’t get to his SharePoint 2010 library.  It’s because we blew away that box due to configuration issues, and didn’t realize he was using it.  Oops!

Fortunately, our Sr. Network Admin (also the DBA) was smart enough to detach the DB (not drop it).  I looked at the content in SSMS and sure enough, that was where his data was.  Here’s what I did to restore his libraries:

  • Open Central Admin for the target SP 2010 instance.
  • Click on Backup and Restore
  • Under Granular Backup, choose Recover data from an unattached content database
  • Enter the name of the DB server and the unattached content DB name.  Leave WIA selected and leave Browse content selected.  Click Next.
  • Leave the site collection the way it is, click Site and select the path you want to restore from (it’s reading from the unattached content DB at this point).  Then do the same for the List (select which List or Library you’re restoring).
  • Select Export site or list and click Next.
  • Enter the path to your target SP2010 instance where you want the export to be saved to (ex: C:backupexport.cmp).  Check Export full security if you want to preserve author names, original creation dates, permissions, etc.
  • Click Start Export
  • When it’s finished (assuming there are no errors), open the SP2010 Management Shell and type the following:

[powershell]import-SPWeb http://site/path/path_to_.cmp_file[/powershell]

That’s it. When it’s done your list/library will be restored!  Careful, though, it will overwrite whatever’s in the target location, so be sure to back up or copy anything that’s already there before importing, so you can restore those items afterwards.

Comments are closed.