To restore a site collection by using Windows PowerShell
- 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 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-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 theDatabaseServerandDatabaseNameparameters 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 Server 2010.
If you are restoring a host-named site collection, use theIdentityparameter to specify the URL of the host-named site collection and use theHostHeaderparameter 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 theForceparameter.
Example:
Restore-SPSite -Identity "http://eis" -Path "c:\backup\eis.bak" -Force