Read time 4 minutes

Summary: Microsoft SharePoint is a widely used cloud service offering various features like Document Library and Sites. This article explores how to back up SharePoint Site Collections using PowerShell commands. Before initiating the backup, ensure a shared folder exists, grant appropriate permissions, and connect servers. The backup process involves specific PowerShell cmdlets, including Backup-SPSite, to safeguard data. Additionally, for SQL Server Enterprise users, the UseSqlSnapshot parameter is recommended for efficient backups, including snapshots.

Microsoft SharePoint stands out as one of the highly favored cloud services, catering to the needs of both large corporations and smaller businesses alike. SharePoint offers a multitude of features and capabilities, including but not limited to Document Libraries and Sites. Within SharePoint, a Site Collection comprises an assembly of diverse sites, with each Site Collection housing a primary top-level site alongside its corresponding subsites.

While it is advisable to create a comprehensive backup of the entire SharePoint farm, it is also possible to back up individual SharePoint site collections. This practice is essential to ensure the safety of your data in the event of any unforeseen disasters. However, performing a backup of a SharePoint site collection can be somewhat complex, requiring the use of PowerShell cmdlets or the Central Administration tool for manual backup. This process may not be the most user-friendly option for those who are not well-versed in technical matters.

In this article, we will discuss how you can backup the SharePoint Site collection with SharePoint Management PowerShell commands. But before that, there are some things to keep in mind.

Things to Know before SharePoint Site Collection Backup using PowerShell

  • Before initiating the backup process, establish a shared folder on the database server. If you intend to relocate the backup folder to a different server, you can do so once the backup is finished. It is essential to transfer the entire backup folder after completing the backup, rather than individual files.
  • The user accounts whose data you want to save should have the access to the shared folder.
  • If you intend to utilize Central Administration for backup purposes, it is essential to ensure that the database server account, timer account, and the Central Administration user identity pool account possess the necessary permissions to execute the backup process effectively.
  • The farm server and database server should connect with each other.
  • If you’re utilizing SQL Server alongside Transparent Data Encryption (TDE) and you’re performing backups using either the SharePoint backup tool or the SQL Server tool, please note that the TDE encryption key won’t be included in the backup process. It will be necessary to manually back up the encryption key.
  • For SharePoint 2013 users, the Administrative service is not automatically started. You will require to manually start it.
Using PowerShell to Backup Site Collection

It requires a brief procedure to backup SharePoint site collection using PowerShell application.

  1. Verify the below-mentioned memberships on the SQL Server instance:
    • securityadmin fixed server role
    • db_owner fixed database role on all databases that are to be updated
    • Administrator group on the server on which you need to run the PowerShell cmdlets

    As an administrator, you can use the Add-SPShellAdmin cmdlet for granting permission to use SharePoint Server cmdlets.
    Note: Without these permissions, you cannot perform the backup. Thus, contact your administrator and request permissions.

  2. Now, start the SharePoint Management Shell.
  3. When the PowerShell command prompt, use the below cmdlets:
    Backup-SPSite -Identity <Site Collection URL or GUID> -Path <Backup File path> [-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose]

    Note: To overwrite a previously used backup file, use Force parameter. Use the NoSiteLock parameter to keep the read-only lock from being set on the site collection during the backup.
    But, using the NoSiteLock parameter can lead to certain data corruption in SharePoint site collection during backup. So, use the following command to display site collection GUID or URL at the PowerShell command prompt:

    Get-SPSite | format-list -property id,url

If your Database server is using an Enterprise edition of SQL Server, then it is recommended to use the UseSqlSnapshot parameter for the backup of the SharePoint. With the help of this parameter, you can export sites or lists even from these snapshots. You can learn about how to use SQL snap-shots from the Microsoft site.

The manual approach is undeniably complex and not suitable for all users. Fortunately, there exists a superior alternative in the form of “Kernel Migrator for SharePoint.” This tool enables users to effortlessly download their SharePoint Site Collection to their local system and subsequently transfer it to another drive or server. With its array of additional functionalities, the SharePoint Migration tool proves to be an exceptional choice for safeguarding your SharePoint data.

Conclusion

Backing up a SharePoint site collection may appear straightforward, but it can be a complex process, especially when relying on manual methods. In this article, we delve into the procedure for SharePoint site collection backup using PowerShell cmdlets. Additionally, we suggest a third-party software solution that offers a more streamlined approach for this task.

Kernel Migrator for SharePoint