Restore a content database (SharePoint Foundation 2010)
Applies to: SharePoint Foundation 2010
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 a farm (SharePoint Foundation 2010).
Note
SharePoint Foundation 2010 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.
Note
If a user has taken copies of content for off-line editing in Microsoft SharePoint Workspace 2010 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.
Procedures in this task:
To restore a content database by using Windows PowerShell
To restore a content database by using Central Administration
To restore a content database by using SQL Server tools
Use Windows PowerShell to restore a content database
You can use Windows PowerShell to restore a content database.
To restore a content database by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Restore-SPFarm -Directory <Backup folder name> -RestoreMethod Overwrite -Item <Content database name> [-BackupId <GUID>] [-Verbose]
Note
If you are not logged on as the Farm account, you are prompted for the Farm account’s credentials.
If you do not use the
BackupId
parameter, the most recent backup will be used. To view a list of the backups, including their Backup IDs, type the following command, and then press ENTER:Get-SPBackupHistory -Directory <Backup folder>
For more information, see Restore-SPFarm.
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.
Use Central Administration to restore a 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
Verify that you are logged on as a member of the Farm Administrators group.
In Central Administration, on the Home page, in the Backup and Restore section, click Restore from a backup.
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
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.
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
If the content database is not selectable, you must use Windows PowerShell or SQL Server tools to restore the content database.
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.
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.
Use SQL Server tools to restore a content database
You can use SQL Server tools to restore a content database by following these steps:
If possible, back up the live transaction log of the content database to protect any changes that were made after the last full backup.
Restore the last full database backup.
Restore the most recent differential database backup that occurred after the most recent full database backup.
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
Verify that the user account performing this procedure is a member of the sysadmin fixed server role.
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.
Start SQL Server Management Studio and connect to the database server.
In Object Explorer, expand Databases.
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.
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.
In the Select a page pane, click Options.
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.
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
For more information about these recovery options, see Restore Database (Options Page) (https://go.microsoft.com/fwlink/p/?LinkId=114420).
Click OK to complete the recovery operation.
Repeat steps 4 through 10 for each database that you are restoring.
Start the Windows SharePoint Services Timer service.
See Also
Concepts
Back up a content database (SharePoint Foundation 2010)
Other Resources
Resource Center: Business Continuity Management for SharePoint Foundation 2010