Backup/Restore Vs Export/Import in SharePoint

Backup Restore SPSite is best used on Top sites, so use Backup and Restore SPSite if you are copying an entire site collection and all of it's sub sites to a new site collection on say a UAT or Production server. 
Use Export\Import SPWeb if you are copying a sub site and it's sub sites to a new location in a different site collection or if you are exporting a particular list or library to later import to a new site.
Make sure when exporting and importing that the site templates of the two sites, match.  In otherwords, if you are exporting from a team site ( webtemplate = STS#0 ) then make sure the target site that you're importing into is also based on the team site template. 


Backup-SPSite:

Backup-SPSite is generally used when you want to replicate the entire site collection (including all subsites) to an existing web application.

It allows you to backup either a site collection or web application.
You can basically consider the file generated more or less as a SQL dump of (a part of) your content database.It preserves the GUID of every object except the GUID of the Site.
When you restore the backup, SharePoint generates a new GUID for the site collection.

Export-SPWeb:
Export-SPWeb is generally used when you want to replicate just a single subsite to an existing site collection, that allows you to backup data of a sub site (SPWeb object), but it can also export a site collection, an entire web application, or a single list. It generates a new GUID for every objects such as sites, sub sites, lists and items.

A major drawback of this operation is that it does not preserves workflows instances, associations, history and tasks.Every workflow association must be recreated and there is no way to restore the running instances from original site.

Export/import is often used to split site collections into multiple pieces when they reached a certain limit. Or to do the vice versa and consolidate multiple site collections into one larger one. Both of these actions work fine as long as the migrated content does not use the publishing feature.

A complete farm backup followed by a restore:
Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New
Back up and restore a service application:
Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full –Item "Excel Services"
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New –Item "Excel Services"
Back up and restore farm configuration information only:
Backup-SPConfigurationDatabase –Directory \\App01\SharePointBackups
Restore-SPFarm –Directory \\App01\SharePointBackups –RestoreMethod Overwrite –ConfigurationOnly
Back up and restore your SharePoint content databases: 
Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full –Item ContosoPortal
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New –Item ContosoPortal
Back up and restore a site collection: 
Backup-SPSite –Identity http://App01/Sites/ContosoPortal -Path \\App01\SharePointBackups\PortalSiteCollection.bak -Force
Restore-SPSite –Identity http://App01/Sites/ContosoPortal -Path \\App01\SharePointBackups\PortalSiteCollection.bak –Force
Export and import a subsite, list, or library:
Export-SPWeb –Identity http://App01/Sites/ContosoPortal/ -Path \\App01\SharePointBackups\SharedDocuments.bak -Itemurl "Shared Documents" -Force
Import-SPWeb –Identity http://App01/Sites/ContosoPortal/ -Path \\App01\SharePointBackups\SharedDocuments.bak –Force -IncludeUserSecurity

Comments

Popular Posts