Learn More About the Bamboo SharePoint Administration Suite

Backups - Policies and Procedures

rated by 0 users
This post has 4 Replies | 2 Followers

Top 25 Contributor
Posts 23
Points 463
jeff.webb Posted: Thu, Aug 7 2008 7:32 PM

A lot of companies invest a lot of money on third party backup software for SharePoint. Those tools are fine -- I've worked with ComVault and Quest products -- but if you don't have budget fo those add-ons the standard SharePoint backup tools can do a good job, Here's a policy document I put together for some of my clients. It seems to work in the field.

I hope you find it useful -- Jeff

 

SharePoint 2007 Backups

SharePoint uses the stsadm –o backup command to backup all of the portal databases and record the structure and status of those backups in an XML file that SharePoint can read from. The backups can then be restored from this page:

http://<central-admin-server:port>/_admin/operations.aspx

The backup process is automated by means of two CMD files that are run as scheduled tasks on the SharePoint front-end server:

·         \WSS3\scripts\sp_backup_full.cmd runs every Saturday night at 11 PM.

·         \WSS3\scripts\sp_backup_inc.cmd runs every day at midnight.

All backups are written to \\<compliance-server>\sharepointbackups\ the backups in that folder are cleared out by sp_backup_full.cmd weekly so the disk does not fill up. It is important that \\<compliance-server>\sharepointbackups\ be written to tape once a week at 10 PM every Saturday to ensure the previous week’s archive is retained.

The backup process keeps error logs at \WSS3\scripts and in the backup directories on \\<compliance-server>\sharepointbackups\. Errors are also viewable from the Backup and Restore history page at this address:

 http://<central-admin-server:port>/_admin/BackupHistory.aspx

Here are the back-up scripts to modify for your use:

echo sp_backup_full.cmd

echo

echo Run on weekend to perform full-backup of all SharePoint web applications.

echo

echo Set variables and paths. Change these to match your set-up.

set backup-dir=\\wombat2\public\backups\sharepoint

set sp-dir=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\

set path=%path%;%sp-dir%

echo Clean up previous week's backups.

del backuplog.txt

rd %backup-dir% /Q /S

md %backup-dir%

echo Begin full backup.

stsadm -o backup -directory %backup-dir% -backupmethod full >> backuplog.txt

 

echo sp_backup_inc.cmd

echo

echo Run every day to perform incremental backup of all SharePoint web applications.

echo

echo Set variables and paths. (Change these to match your set-up.)

set backup-dir=\\wombat2\public\backups\sharepoint

set sp-dir=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\

set path=%path%;%sp-dir%

 

echo Begin incremental backup.

stsadm -o backup -directory %backup-dir% -backupmethod differential >> backuplog.txt

 

  • Filed under:
  • | Post Points: 22
Top 10 Contributor
Posts 30
Points 425

Nice post Jeff. I love using the native backup commands for Sharepoint.

I've been dabbling with adding the lines necessary to auto-delete backups older than 2 weeks, but haven't been able to finish. It's also nice to add a snippet of code to email a zip file of the log or just the results of the backup being successful or note. 

Mike Ferrara | President

Ferrara Data Consulting

View Mike Ferrara's profile on LinkedIn

  • Filed under:
  • | Post Points: 22
Top 25 Contributor
Posts 23
Points 463
jeff.webb replied on Wed, Sep 10 2008 4:25 PM

 Hey Mike,

Here's how you'd do a 2 week clean up:

Remove these lines from the weekly backup script:

rd %backup-dir% /Q /S

md %backup-dir%

And put them in a separate script schedule to run every two weeks. I know that could get a little complicated if you wanted to have much more logic than that, so it's best to keep it simple.

Something else I've thought of is just writing it all to a separate USB drive without any clean-up then swapping drives every month (or week depending on your db size). I like the USB drive approach because it allows off-site storage, it's cheap, fast, and a little different!

As far as emailing the log... I think it's better to add a virtual folder to a SharePoint site using the IIS manager that holds log files and other types of utility output (l use stsadm to create a map of site collections for example). It's then possible to use that "physical" folder to view those files from the browser within the context of the SharePoint site.

 

Top 10 Contributor
Posts 30
Points 425

You're right it could get a little complicated. I was thinking of just adding the logic to count the number of folders in the backup directory and delete anything over 14 with the oldest dates.

I do like the idea of using a virtual folder for the logs. The reason why I suggested the email addition is so that I can get updates when I'm mobile. There's always those times when something doesn't run right and you don't find out until Monday morning, when a simple email with the results could tip you off first.

Mike Ferrara | President

Ferrara Data Consulting

View Mike Ferrara's profile on LinkedIn

Top 10 Contributor
Posts 30
Points 425

In continuation of ideas on what all the best practices could be for backups.... for Win2008/Vista environments I think tagging could really be a nice feature for automated deletestiny_mce_marker. You could tag files with either a "full" or "differential" tag, and write the query to analyze files based on the appropriate tag. Then you could just delete any "full" backups that are older than 2 weeks. I've not really delved into the new script commands for Vista, but I would love to see that in action. If I have time to research this, then I will post my results here.

Mike Ferrara | President

Ferrara Data Consulting

View Mike Ferrara's profile on LinkedIn

Page 1 of 1 (5 items) | RSS
  
Bamboo Solutions Corporation, 2002-2008