Introduction
Backup and Restore is one of most crucial and important parts of an application. Once an application is developed and deployed into the server, it is mandatory to maintain the backups from time to time so that it to be used for things like disaster recovery, rolling back the application to a certain point if any upgrade fails, and so on. In this article we will learn about the backup and restore of SharePoint applications.
SharePoint provides multiple options to achieve backup operations effectively. We can choose any one of the features to perform backup and restore based on our needs. In this article we will go through the available options using which we can perform backup and restore.
Central Administration provides us with two options namely "Farm Backup" and "Granular Backup." Granular Backup allows us to perform backup at list, library, site and site collection level. Granular backup will be very useful when it comes to backup and restore of individual components of a SharePoint Portal. On the other hand, Farm Backup as the name suggests is useful when we want restore complete web applications, which includes all site collections, service applications, and so on.
Granular Backup
Granular backup allows us to perform Site backup, list/library backup and site collection backup. Now in the below activity will look at on how to perform backup and restore of a list in a SharePoint Site.
- Navigate any one of the available SharePoint sites. Click on the ribbon and click on "View all Site Contents." In this example we are going to create a sample list to perform backup operations.
- Click on Create an App and Choose Custom list from the available templates and click on create and give the name of the list as "Records."
- Now the created list is available in the site contents. We can add a few records to it and the final contents of the list looks like below:
- Now go to the central administration website and click on the "Backup and restore" available in the left side navigation. It will redirect to the backups page, where you can find the "Farm Backup and Restore" and "Granular Backup".
- Click on "Export a site or list" under "Granular Backup" option and fill the following options in the landing page.
- Choose URL of Site Collection from which you want to take the backup of the list, then choose the URL of Site and finally choose the name of the list (in our example, "Records").
- Give the path for the backup file followed by the file name with extension with ".cmp"
- Choose check box "Export full security" and choose "All Versions" from the dropdown.
- The options are shown as below:
- Once the backup is performed successfully, we will be able to see the backup file in the specified location as shown below:
- Alternatively, we can achieve the above list backup using the following SharePoint powershell command
Export-SPWeb "http://www.domain.com/" -itemurl "/Lists/test" -path "c:\test.cmp"
- Now go to the SharePoint Site and delete one or two records from the list. We can also make sure that we have deleted the reocrds from site recycle and end user recyclic bin as shown below:
- Now click on the "SharePoint 2013 Management Shell," which opens powershell command window where we can run the commands to perform restore from the created backup file.
- The following command is used to perform restore of the list to the site.
Import-SPWeb "http://win-7neb4ol28vu:15184" -Path "\\win-7neb4ol28vu\D\backup\Records.cmp"
- Interestingly, if we observe that after the restore is done our deleted records are added back to the list but with different "ID"s. This is happened because the versioning of the list was not enabled.
- Now if perform same procedure with versioning enabled, after once the restore is done with versioning enabled, we can observe that the records are restored with the "ID"s.
- There are few other flags that can used with the import command like ‘-Force’ and ‘-UpdateVersions’ which are used to overwrite the list if the list exists and restore the entire version respectively. More information about working with backup and restore commands can be found in TechNet articles.
Farm Backup
Farm backup and restore is straight forward and can be easily done using Central Administration site. Below are the steps which are used to achieve the same:
- Go to Central Administration, click on "Backup and Restore" from the left navigation click on the "perform a backup" under "Farm Backup and Restore".
- The backup page provides us with the wide range of choices to choose from, components starting with the server side solutions to complete Web Application along with individual Service application proxies.
- The below is the snapshot of the same:
- Once you’re done with the selection of the required components for the backup, in the next page, we will have the following settings that can be applied:
- Backup Type: has to options to choose from "Full" and "Differential".
- Backup Configuration settings,
- Backup File Location.
- After all the settings are done, we can start the backup. The following is the result page of the backup.
- Now once backup is done. We can perform the restore using the "Restore from a backup" option.
- The below screenshots show the backup and restore procedure screenshots.
Points of Interest
This article is part of series of articles on SharePoint for beginners.
Below are the list of articles on "SharePoint for beginners."
- SharePoint - Web Application Management
- SharePoint Lists and Libraries
- SharePoint Features, Packages and Solutions.
- SharePoint Backup and Restore