Restore a site collection (SharePoint Foundation 2010)
Applies to: SharePoint Foundation 2010
Topic Last Modified: 2011-08-08
You can use only Windows PowerShell to restore a site collection.
|The SharePoint 2010 Service Pack 1 (SP1) upgrade process alters the schema of all content databases. Because of these changes, you might need to take additional steps to restore a backup that you made before the farm was upgraded to SP1 to the farm after it is upgraded to SP1. For more information about doing this, see Restore pre-SP1 backups to an SP1 farm (SharePoint Foundation 2010).|
You can use Windows PowerShell to restore a site collection manually or as part of a script that can be run at scheduled intervals.
|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.|
Verify that you meet the following minimum requirements: See Add-SPShellAdmin. Additionally, verify that the user account performing this procedure has read permissions to the backup folder and is a member of the db_owner fixed database role on both the farm configuration database and the content database where the site collection is being restored.
On the Start menu, click Administrative Tools.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Restore-SPSite -Identity <Site collection URL> -Path <Backup file> [-DatabaseServer <Database server name>] [-DatabaseName <Content database name>] [-HostHeader <Host header>] [-Force] [-GradualDelete] [-Verbose]
If you want to restore the site collection to a specific content database, use the
DatabaseNameparameters to specify the content database. If you do not specify a content database, the site collection will be restored to a content database chosen by Microsoft SharePoint Foundation 2010.
If you are restoring a host-named site collection, use the
Identityparameter to specify the URL of the host-named site collection and use the
HostHeaderparameter to specify the URL of the Web application that will hold the host-named site collection.
If you want to overwrite an existing site collection, use the
Note If the site collection that you are restoring is 1 gigabyte or larger, you can use the
GradualDeleteparameter for better performance during the restore process. When this parameter is used, the site collection that is overwritten is marked as deleted, which immediately prevents any additional access to its content. The data in the marked site collection is then deleted gradually over time by a timer job instead of all at the same time, which reduces the impact on server performance.
For more information, see Restore-SPSite.
|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.|