4. Example of Performing a SharePoint 2010 Farm Backup and Restore
Typically, you will schedule your backups during off-peak hours using a script containing Windows
PowerShell or STSADM commands. During a disaster recovery, you can use
Central Administration to restore the backups that were generated by
these scripts. This section demonstrates the use of Windows PowerShell
to perform a farm backup, followed by an explanation of how to complete a
Central Administration farm restore from the backup created using
Windows PowerShell.
4.1. Performing a Farm-Level Backup Using Windows PowerShell
To begin, create a Windows PowerShell script .ps1 file containing the following command:
Backup-SPFarm -Directory \\App01\SharePointBackups -BackupMethod Full
This command is issued from
the Central Administration server of your SharePoint farm, and it will
perform a backup of all of your SharePoint information including all
farm configuration information, databases, Web applications, and service
applications. The –Directory
parameter indicates that the network share called SharePointBackups on
server App01 is where the folder should be created that will contain the
files from this backup operation. The –BackupMethod parameter value Full indicates that you are backing up all SharePoint farm information.
When the command completes,
you will see a directory located in the SharePointBackups directory with
a name similar to spbr0000. The 0000 counter will increase in
increments of 1 as you perform future backups.
4.2. Using Central Administration to Restore Your Windows PowerShell Backup
You can use Central Administration to restore the backup you created using Windows PowerShell by following these steps.
In Central Administration, in the Backup And Restore section of the Home page, click Restore From A Backup.
On
the Restore From Backup – Step 1 Of 3: Select Backup To Restore page,
select the backup job from the list of backups that contains the farm backup, as shown in Figure 2, and then click Next.
Note:
If the correct backup job does
not appear in the list, enter the UNC path of the correct backup folder
in the Backup Directory Location text box and then click Refresh.
On
the Restore From Backup – Step 2 Of 3: Select Component To Restore
page, select the check box next to the top-level component that you want
to restore, as shown in Figure 3, and then click Next.
On the Restore From Backup – Step 3 Of 3: Select Restore Options page, in the Restore Component section shown in Figure 4,
ensure that Farm is the selection that appears in the Restore The
Following Content list. In the Restore Only Configuration Settings
section, ensure that the Restore Content And Configuration Settings
option is selected. In the Restore Options section, select the Type Of
Restore option. Use the Same Configuration option to restore the entire
farm to the same server. Choose the New Configuration option to restore
the entire farm during a disaster recovery or are migrating the farm to a
different location. If you select the Same Configuration option, a
dialog box will appear that asks you to confirm the operation. Click OK.
Note:
If the Restore Only
Configuration Settings section does not appear, the backup that you
selected is a configuration-only backup. You must select another backup.
You can view the general status of all recovery jobs in the Status section at the top of the Backup And Restore Status page, as shown in Figure 5.
You can also view the status for the current recovery job in the
Restore section in the lower part of the page; the status displayed
there automatically updates every 30 seconds. Alternatively, you can
update the status details manually by clicking Refresh. If you receive
any errors, you can review them in the Failure Message column of the Backup
and Restore Job Status page. You can also find more details in the
Sprestore.log file at the UNC path that you specified earlier in the
Backup Directory Location text box.
4.3. Using SQL Server for Backups and Restores
SharePoint information also
can be backed up and restored by your SQL Server DBAs or by anyone who
is a member of the SQL Server db_backupoperator fixed database role for
that database. This method is often utilized when there is a SQL Server
DBA who is responsible for all company data. SQL Server DBAs can perform
backups and restores using SQL Server Management Studio or using the
T-SQL BACKUP DATABASE and RESTORE DATABASE commands. A T-SQL backup also
can be scripted and scheduled to run at specified times.
There are several
additional options available when performing a backup from within SQL
Server that often only a SQL Server DBA will completely understand; the
DBA may be able to leverage these options to streamline the restore
process, manage the backups, and ensure the integrity of the data. Some
of these SQL Server specific options include
Creating a copy of the database without affecting the scheduled database backup
Setting an expiration date for the backup
Performing a transaction log backup
Verifying the integrity of the backup on completion
Creating a checksum on backed-up data to verify that data was not tampered with