Recover Data from an Unattached Content Database

Being able to recover data from an unattached content database is quite a useful feature. The primary benefit is that you do not need a separate recovery farm when restoring site collections, websites, or lists and libraries. Here is a broad overview of the steps for using this feature:

1. Restore the content database from backup to any network-accessible SQL server.

2. Point SharePoint to this restored database (this is where the term unattached content database applies) and either back up the site collection or export the websites/list/library that need to be recovered.

3. Restore the site collection or import the websites/list/library.

The unique capability is in step 2, where SharePoint is able to access this database even though it is not actively attached to your farm.

With this feature, your recovery options open up significantly, provided you have made a complete farm backup. Recall in the “Using Central Administration to Perform a Component-Level Backup” section, earlier in this chapter, that the smallest component backed up is a content database. What if you lose just one website or a site collection gets corrupted? If you restore the whole content database, all site collections in the database are restored to a previous state. You will lose the data in the site collections that changed since the last backup.

Using unattached content database recovery, it’s a different story. You can point to the single site collection that is corrupted and just restore it. Or you can point to the website or library and just restore it. In other words, you have more granular restore options, even though you only have a farm backup.

Performing unattached content database recovery requires using a mixture of administration tools. Step 1 usually involves doing a restore from SQL Server. Step 2 can be done with Central Administration or PowerShell. Step 3 requires PowerShell and is the same type of restore or import as covered in previous sections.

Restoring a Content Database

When performing an unattached content database recovery, the first step is to restore the content database. It is best to restore directly from SQL Server Management Studio, the administrative program for SQL Server.

WARNING If you intend on restoring the database to the same SQL server, be very careful that you do not restore to the same database name. Instead, use a temporary name.

You can also restore the database to any network-accessible SQL server, provided your SharePoint Farm account has dbcreator and securityadmin server role permissions and the version of the SQL server is the same or newer.

When restoring the database, you can restore it from any farm-level SharePoint backup that includes the content database as a component—for example, a complete farm backup. To identify which database backup file to restore, see the spbackup.xml file found in the corresponding SPBRxxxx folder. See “Understanding Farm Backup Sets,” earlier in this chapter, for more information. If your DBA has been taking direct backups of your content databases from SQL Server, this backup can also be restored.

For specific steps on how to restore a database from SQL Server, see the article “How to: Restore a Database Backup (SQL Server Management Studio)” at http://msdn.microsoft.com/en-us/library/ms177429.aspx.

Using Central Administration to Recover Data from an Unattached Content Database

Once the database is restored, you can perform an unattached content database recovery. As a reminder, in this procedure you will back up or export the site collection or website/list. This must be done before you can issue the restore or import. Here are the steps:

1. Click Backup And Restore, then select Recover Data From An Unattached Content Database.

2. As shown in Figure 16.6, specify the database server where the database was just restored.

Figure 16.6: Unattached content database recovery

image

3. Enter the database name.

4. For Operation To Perform, the easiest choice is to select Browse Content (the default).

5. Click Next.

6. To browse content, first select the site collection in the content database.

7. Optionally, select the website in this site collection. If you do not select a website, you can only back up the site collection.

8. Optionally, select a list or library from the selected website.

9. For Operation To Perform, depending on what you did in steps 7 and 8, select either Backup The Site Collection or Export Site Or List.

10. Click Next.

11. The options presented on this final page depend on whether you selected Site Collection Backup or Export Site Or List. Either way, they are the exact same options you see when using Central Administration to back up a site collection or to export a website/list, so review the previous sections if you need more details.

12. Click Start Backup. A timer job is created and is scheduled to run immediately.

Restoring or Importing Content

The final procedure is to restore the site collection or import the website/list generated from the previous section. This is done using PowerShell, and you can use either Restore-SPSite or Import-SPWeb. There is nothing special about this type of restore, so consult the “Using PowerShell to Restore a Site Collection” or the “Using PowerShell to Import” section earlier in this chapter.

Once the restore or import completes, and you have confirmed all is working, you can delete the temporary database that was restored.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.34.39