Friday, April 11, 2014

How to take backup of farm,web application,site collection,site,list and library, service application and SharePoint configuration using PowerShell

SharePoint PowerShell Backup and Restore Commands

The following are examples of different SharePoint PowerShell commands you can use to back up and restore various components of your SharePoint environment.
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

No comments:

Post a Comment