SharePoint 2007 Backups

Copyright © 2007, Jeff Webb http://www.essentialsharepoint.com/. You are free to copy, use, or modify this document as long as you retain this attribution.

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