Granular Backups and Restores in SharePoint 2010
You can backup and restore either a complete Site Collection or individual Sites, either using the Central Administration’s granular backup/restore feature or with the PowerShell cmdlets. In this article I will offer the details for both methods. Let’s get right to it.
Backup Up Site Collection Using Central Administration
Go to Central Administration -> Backup and Restore -> Granular Backup -> Perform a site collection backup.
Backup Site Collection Using PowerShell
Use the following PowerShell syntax to backup a Site Collection.
backup-spsite -identity Site_URL -path \\server\share\filename.bak
For example:
backup-spsite -identity http://seattlepro.com -path \\SharePoint\Backups\SeattlePro.bak
Restore a Site Collection Using Central Administration
There is no option in Central Administration to perform a granular restore of a Site Collection. You must use PowerShell to restore a Site Collection.
Restore a Site Collection Using PowerShell
To restore a Site Collection use the restore-spsite cmdlet. This will allow you to restore Site Collections that were backed up either using Central Administration’s Perform a site collection backup link, or were backed up using backup-spsite cmdlet. Here’s the syntax.
restore-spsite -identity Site_URL -path \\server\share\filename.bak
For example:
restore-spsite -identity http://intranet.seattlepro.com -path \\SharePoint\Backups\Intranet.bak
NOTE: If the Site Collection already exists, you can use the -force switch at end of the above URL to overwrite the existing site. For example:
restore-spsite -identity http://intranet.seattlepro.com -path \\SharePoint\Backups\Intranet.bak -force
Export a Site Using Central Administration
Go to Central Administration -> Backup and Restore -> Granular Backup -> Export a site or list.
Export a Site Using PowerShell
To export a SharePoint 2010 Site, Library or a List, use the export-spweb cmdlet. Here’s the syntax.
export-spweb -identity Site_URL -path \\server\share\filename.cmp
For example:
export-spweb -identity http://extranet.seattlepro.com/microsoft -path \\SharePoint\Backups\Extranet.cmp
Import a Site Using PowerShell
Use import-spweb cmdlet to restore a SharePoint 2010 site, library or a list that was exported either in Central Administration with export site or list option, or with export-spweb cmdlet.
To import a site called SeattlePro located at http://extranet.microsoft.com/seattlepro first make sure that the site exists with the same template that was exported (e.g. a Team Site template). You can’t use a blank template to import a site that used a Team Site template. If import fails, look in the import log file. It will tell you which template the exported site used.
Cannot import site. The exported site is based on the template CMSPUBLISHING#0 but the destination site is based on the template STS#0. You can import sites only into sites that are based on same template as the exported site.
CMSPUBLISHING#0 is a Publishing Site template, while STS#0 is a Team Site template. Recreate the site with the same template and then import an exported site using this PowerShell cmdlet.
import-spweb -identity URL_for_Imported_Site -path \\servername\sharename\filename.cmp
For example:
import-spweb -identity http://extranet.seattlepro.com/microsoft -path \\SharePoint\Backups\Microsoft.cmp
Granular Backup Job Status
To check the status of your backup job, go to Central Administration -> Backup and Restore -> Granular Backup ->Check granular backup job status, or use the following URL.
http://Server:Port#/_admin/SiteBackupOrExportStatus.aspx
For example:
http://SharePoint:5678/_admin/SiteBackupOrExportStatus.aspx
Summary
To restore a site collection that was backed up with either Central Administration’s “Perform a site collection backup” option, or using backup-spsite cmdlet, use restore-spsite cmdlet.
To restore a Site, Library or a List that was exported either in Central Administration with “Export a site or list” option, or with export-spweb cmdlet, use import-spweb cmdlet.
Copyright ©2010 Zubair Alexander. All rights reserved.