How do you backup and restore a site collection in SharePoint 2010? Usually, administrators are considered the only option, but in fact SharePoint 2010 also provides a relatively easy and convenient way to perform these operations with several simple PowerShell commands.
When you are Backup and Restore a site collection, you are actually performing 3 separate operations:
- Backup the site to a single file.
- Create a new site collection as the target site collection.
- Do the Restore.
1. Backup SharePoint site collection
A. Click “Start” enter “All Programs.”
B.?Select “SharePoint 2010 Management Shell“(Run as Administrator).
C. Execute the following command as shown in figure 1:
backup-SPSite http://kongyang:8081 -Path C:\8081.bak
D. The backup file 8081.bak has been generated in the Local Desk (C:) .
Note: http://kongyang:8081 is the name of the web application to be backed up.
2. Create Target Site Collection
SharePoint site collection is based on the web application, so we need to create a web application for the target site collection. And don’t forget to take attention to the Database Server name and Database name.
A. Create a web application (As shown in the Figure 2)
B. Create site collection for the web application
3. Restore site collection
A. Click “Start“ enter “All Programs.”
B. Select “SharePoint 2010 Management Shell“(Run as Administrator).
C. Execute the following command as shown in Figure 3:
Restore-SPSite http://kongyang:2345 -Path C:\8081.bak -Force -DatabaseServer KONGYANG -DatabaseName wss_content_8081backup
D. Input “A,” then press “Enter,” will execute the restore.
Note: KONGYANG is the name of Database Server. wss_content_8081backup is the name of Database.