Backup and Restore the SharePoint Site Collection Using Management Shell

In this article, I would like to share the command for taking a backup of a SharePoint site collection and how to restore the SharePoint site collection using the Management Shell.

Backup

The following is the procedure to take the backup of a SharePoint site collection.

Step 1: Open the SharePoint Management Shell from Microsoft SharePoint products.

SharePoint site collection

Step 2: Then click on the SharePoint 2013 Management Shell, you will get the Management Shell window as shown below:

SharePoint 2013 Management shell

Step 3: Write the following command in the Management Shell to back up a site collection:

Backup-spsite

Backup-spsite

Step 4: Then enter the SharePoint site collection URL in “Identity” as shown below:

Identity: http://ils-kaviyab:55555/ < URL>

Identity

Step 5: Then provide the Windows Explorer path to save your backup as in the following:

Path: <path>\<backupfilename>.bak
 
Path

Then press the Enter key to take the backup. The site backup will be completed successfully.
 
Site backup

Restore
The following is the procedure to restore a SharePoint site collection.

Step 1: Open the SharePoint Management Shell, then write the following command in the Management Shell to restore a site collection:

restore-spsite
 
restore-spsite

Step 2: Then enter the SharePoint web application URL in “Identity” as shown below:

Identity: http://ils-kaviyab:22222/ <URL >
 
URL in Identity

Step 3: Then provide the backup path to restore your backup and press the Enter key, you will get options as shown in the following image.

Path: <path>\<backupfilename>.bak
 
Backup path

Step 4: Then provide [A] – Yes to the all option to restore the entire site collection:
 
restore whole site collection

Press the Enter key to restore the site collection, then the site collection will be restored successfully.
 
restored successfully

Summary

In this article we explored how to take the backup of a SharePoint site collection and restore the site collection.