Backup And Restore Site Collection In SharePoint Server 2016

Backup and Restoration of site collections in SharePoint is one of the common administrative tasks. In this blog, we will see how to perform the backup and restoration of Site Collections in SharePoint Server 2016, using PowerShell.

PowerShell

Spin up SharePoint 2016 Management Shell.

http://www.c-sharpcorner.com/blogs/whats-making-automated-software-testing-so-important

Run the command, given below, to create a back up of the site collection-

  1. Backup-SPSite -Identity "http://sharepoint2016:51000" -Path "C:\BackUp\SiteCollBU.bak" –Force   
-Identity : It specifies the site collection URL, which has to be backed up.

-Path : It specifies the location, where the .bak file will be generated.

-Force : Use this parameter to replace any existing .bak file with the same name.

http://www.c-sharpcorner.com/blogs/whats-making-automated-software-testing-so-important

After running the script, we will get a .bak file at the specified location.

http://www.c-sharpcorner.com/blogs/whats-making-automated-software-testing-so-important

We can run the command, given below to restore the site collection-
 

 

  1. Restore-SPSite -Identity "http://sharepoint2016:51000/sites/RestoredSiteColl" -Path "C:\BackUp\SiteCollBU.bak"  

-Identity: Site collection URL to where the backup will be restored. This site collection need not exist. It will be created during the process.

-Path : Location of the backup file.

However there is a caveat, a content database can have only one copy of the site collection. Thus, if the Web Application has only one content database and we are trying to restore the site collection to the same Web Application, we will get the error, shown below-



In order to resolve this, make sure that there is an additional content database other than the content database of the original source site collection.



Running the Restore script has now run to the completion.



Let’s check out the restored site collection.



Summary - Thus, we saw how to backup and restore a site collection in SharePoint Server 2016, using SharePoint 2016 Management Shell.