SharePoint 2010 Disaster Recovery Planning – Part II


To have a successful Disaster Recovery Plan (DRP) you need to be able backup and restore your product. This article will lay out a scripted Farm backup method.

NOTE: Scripts are included as-is and are intended as an example to use. Administrators should edit their scripts to meet their own business needs.

Microsoft recommends using the built-in Sharepoint Farm backup tools. Click Here for more information.

Below are 2 scripts that can be scheduled via Windows Task Scheduler to run a Farm backup. The first script is the backup script in PowerShell.

**There is no GUI method provided by Microsoft for scheduling the Farm backups**

Auto_Farm_Backup_Full.ps1
# Adds the Sharepoint Powershell snapin so scheduling via Windows Scheduler will complete using cmd shell

Add-PSSnapIn Microsoft.SharePoint.PowerShell

# Backs up the Farm via a Full backup

Backup-SPFarm -Directory "\\servername\share" -BackupMethod Full -Force -Verbose

If you are performing Differential backups change the <FULL> in the script above to <Differential> and save as a new script.

This second script is a batch file to be used to call the first script in the Windows Task Scheduler. The reason for the batch file is simply to ensure your PowerShell script is run in PowerShell not the Command.exe.

Execute_Auto_Farm_Backup_Full.bat
Powershell -command "\\servername\share\Auto_Farm_Backup_Full.ps1"
 
Ensure the account running these scripts has Read/Write permissions to the backup directory as well as the SQL Service account that is performing the backup.
 

In all you will have 4 scripts. Two for your weekly full backup and two for your daily differentials assuming you choose to do differentials. A typical backup schedule might look similar to the one below.

Day of Week

Backup Start Time

Backup Type

Saturday

2:00am

Full

Sunday

2:00am

Differential

Monday

2:00am

Differential

Tuesday

2:00am

Differential

Wednesday

2:00am

Differential

Thursday

2:00am

Differential

Friday

2:00am

Differential

This should get you going in the right direction in your DRP process. Don’t assume because you’ve got backups, however, that you’re protected and your DRP is done. We’re far from done so stay tuned for more ideas.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s