Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Restore content databases in SharePoint 2013

Published: July 16, 2012

Summary: Learn how to restore a content database in SharePoint 2013.

Applies to:  SharePoint Foundation 2013 | SharePoint Server 2013 

You can restore a content database in SharePoint 2013 by using the SharePoint Central Administration website, Windows PowerShell, or SQL Server tools. The restore tool that you use depends on the kind of environment that you have deployed, your schedule requirements, and service level agreements that you have made with your organization.

In this article:

Before you begin

You can restore any content database or several content databases, one at a time. For information about how to back up all the content databases in a farm at the same time, see Back up farms in SharePoint 2013.

Before you begin this operation, review the following information about how to restore a content database:

  • SharePoint Server restores up remote Binary Large Objects (BLOB) stores but only if you are using the SQL Filestream remote BLOB store provider to place data in remote BLOB stores.

    If you are using another provider you must manually restore these remote BLOB stores.

  • If a user has taken copies of content for off-line editing in and the content is restored from a backup on the server, when the user re-connects, the server automatically synchronizes the off-line content with the restored content. This might result in data loss on the user's copies of the content.

note Note:

Because SharePoint 2013 runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint 2013 supports the accessibility features of supported browsers. For more information, see the following resources:

Using Windows PowerShell to restore a SharePoint content database

You can use Windows PowerShell to restore a content database.

To restore a content database by using Windows PowerShell

  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 Products cmdlets.

    note Note:

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.

  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. At the Windows PowerShell command prompt, type the following command:

    Restore-SPFarm -Directory <BackupFolder> -RestoreMethod Overwrite -Item <ContentDatabase> [-BackupId <GUID>] [-Verbose]
    

    Where:

    • <BackupFolder> is the name and path for the backup folder where the service application was backed up.

    • <ContentDatabase> is the name of the content database.

    If you do not use the BackupId parameter, the most recent backup will be used. To view all of the backups for the farm, type the following command at the Windows PowerShellcommand prompt:

    Get-SPBackupHistory -Directory <Backup folder>
    

For more information, see Restore-SPFarm.

note Note:

We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

Using Central Administration to restore a SharePoint content database

You can use Central Administration to restore a farm or components of a farm.

To restore a content database by using Central Administration

  1. Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.

  2. Start SharePoint 2013 Central Administration.

    • For Windows Server 2008 R2:

      • Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Central Administration.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Central Administration.

        If SharePoint 2013 Central Administration is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Central Administration.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. In Central Administration, on the home page, in the Backup and Restore section, click Restore from a backup.

  4. On the Restore from Backup — Step 1 of 3: Select Backup to Restore page, from the list of backups, select the backup job that contains the content database backup, and then click Next.

    note Note:

    If the correct backup job does not appear, in the Current Directory Location text box, enter the path of the correct backup folder, and then click Refresh.

  5. On the Restore from Backup — Step 2 of 3: Select Component to Restore page, select the check box that is next to the content database, and then click Next.

    note Note:

    If the content database is not selectable, you must use Windows PowerShell or SQL Server tools to restore the content database.

  6. On the Restore from Backup — Step 3 of 3: Select Restore Options page, in the Restore Options section, under Type of Restore, click the Same configuration option. A dialog box appears that asks you to confirm the operation. Click OK.

    Click Start Restore.

  7. You can view the general status of all recovery jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current recovery job in the lower part of the page in the Restore section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take several seconds for the recovery to start.

    If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Sprestore.log file at the UNC path that you specified in step 2.

Using SQL Server tools to restore a SharePoint content database

You can use SQL Server tools to restore a content database by following these steps:

  1. If possible, back up the live transaction log of the content database to protect any changes that were made after the last full backup.

  2. Restore the last full database backup.

  3. Restore the most recent differential database backup that occurred after the most recent full database backup.

  4. Restore all transaction log backups that occurred after the most recent full or differential database backup.

To restore a content database by using SQL Server tools

  1. Verify that the user account performing this procedure is a member of the sysadmin fixed server role.

  2. If the Windows SharePoint Services Timer service is running, stop the service and wait for several minutes for any currently running stored procedures to finish. Do not restart the service until after you restore the content databases.

  3. Start SQL Server Management Studio and connect to the database server.

  4. In Object Explorer, expand Databases.

  5. Right-click the database that you want to restore, point to Tasks, point to Restore, and then click Database.

    The database is automatically taken offline during the recovery operation and cannot be accessed by other processes.

  6. In the Restore Database dialog box, specify the destination and the source, and then select the backup set or sets that you want to restore.

    The default values for destination and source are appropriate for most recovery scenarios.

  7. In the Select a page pane, click Options.

  8. In the Restore options section, select only Overwrite the existing database. Unless the environment or policies require otherwise, do not select the other options in this section.

  9. In the Recovery state section:

    • If you have included all the transaction logs that you must restore, select RECOVER WITH RECOVERY.

    • If you must restore additional transaction logs, select RECOVER WITH NORECOVERY.

    • The third option, RECOVER WITH STANDBY is not used in this scenario.

      note Note:

      For more information about these recovery options, see Restore Database (Options Page).

  10. Click OK to complete the recovery operation.

  11. Repeat steps 4 through 10 for each database that you are restoring.

  12. Start the Windows SharePoint Services Timer service.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.