You are on page 1of 4
sargeoi soci sr Backup-SPSite Applies to: SharePoint Foundation 2013, SharePoint Server 2013 Enterprise Topic Last Modified: 2015-03-09 Performs a backup of a site collection, Syntax Backup-SPSite [-Identity] Path [-AssignmentCollection ] [-Confirm []] [-Force ] [- NoSiteLock ] [-UseSqlSnapshot ] [-whatIf []] Detailed Description ‘The Backup-SPSite cmadlet performs a backup of the site collection when the Identity parameter is used By default, the site collection will be set to read-only for the duration of the backup to reduce the potential for user activity during the backup operation to corrupt the backup. f you have SQL Server Enterprise Edition, we recommend that UseSqlSnapshot parameter be used because this ensures a valid backup while it allows users to continue reading and writing to the site collection during the backup. SharePoint Management Shell Parameters Parameter Required Type Description Identity Required MicrosoftSha | Specifies the URL or GUID of the site collection to be backed up. rePoint.Power ShellSPSitePi | For example, a valid URL, such as peBind http://server_name/sites/site_name or a GUID such as, "01234567- 89ab-cdef-0123-456789abcdeh Path Required System String | Specifies the full path to the backup file (that is, ‘CABackup\site_name.bak Assignment — Optional MicrosoftSha | Manages objects for the purpose of proper disposal. Use of objects, Collection rePointPower such as SPWeb or SPSite, can use large amounts of memory and ShellSPAssig _ use of these objects in Windows PowerShell scripts requires proper hitps:/Rechnet microsof.comlan-sslbraryi#50790 1 (S=printer aspx ws torr9i2017 nmentCollecti on Confirm Optional System Mana gementAuto mation Swite Parameter Force Optional System Mana gementAuto mation Swite Parameter Optional systemMana gement Auto mation Swite Parameter UseSqlsnaps Optional system Mana hot gementAuto mation Swite hParameter Whatif Optional System Mana gementAuto hitps:/Rechnet microsof.comlan-sslbraryi#50790 1 (S=printer aspx Backup-SPSite memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used. Note: When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of- memory scenario can occur. Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters Specify to overwrite an existing backup file if it already exists Specifies the site collection to remain read and write during the backup, If the NoSiteLock parameter is not specified, then a site collection that has a site collection lock setting of "none" or “no additions" will be temporarily set to "read only" while the site collection backup is performed, Once the backup has completed, the site collection lock will return to its original state. The backup package will record the original site collection lock state so that itis restored to that state, If users are writing to the site collection while the site collection is being backed up, then the NeSiteLock parameter is not recommended for potential impact to backup integrity Specifies a SQL Database Snapshot will be created when the backup begins, and all site collection data will be retrieved directly from the database snapshot. This snapshot will be deleted automatically when the backup completes ‘The UseSqlSnapshot parameter is recommended if the database server hosting your content database supports database snapshots such as SQL Server Enterprise Ecltion and SQL Server Developer Edition. This is because it will ensure a valid backup while allowing users to continue reading and writing to the site collection during the backup. Itis not necessary to specify the NoSiteLock parameter when specifying the UseSqlSnapshot parameter. Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters 214 torr9i2017 Backup-SPSite mation Swite Parameter Input Types Return Types Example Backup-SPSite http: //server_name/sites/site_nane -Path C:\Backup\site_name.bak This example backs up a site collection at http://server_name/sites/site_name to the C:\Backup\site_name-bak file. EXAMPLE Get-sPSitesdninistration http://server_nane/sites/site_nane | Backup-SPSite -Path C:\Backup\site_name.bak This example backs up a site collection at httpi//server_name/sites/site_name to the C\Backup\site_name.bak file, Same result as Example 1, but a different way of performing the operation. Backup-SPsite http: UseSqlSnapshot //server_nane/sites/site_name -Path C:\Backup\site_name.bak - This example backs up a site collection using database snapshots to ensure backup integrity See also Get-sPSite Move-SPSite Restore-SPsite Set-SPSite Get-SPSiteAdministration hitps:/Rechnet microsoft.comlan-sslbraryi#50790 1 (d=printer.aspx 34 so1s9/2017 © 2017 Microsoft hitps:/Rechnet microso.comfen-ssorary¥80790 Backup-SPSite a

You might also like