A big issue that many administrators have with Windows SharePoint Services 2.0 and SharePoint Portal Server 2003 is a very negative impact on performance when performing site collection level backups on production systems. It became such an issue, that the Microsoft SharePoint Product Groups changed the Administrators guide to explicitly reflect a change in support of using site collection level backups.
The Microsoft Knowledge Base Article 889236 was updated as follows (I’m placing the important parts in bold red):
Supported scenarios for using the Stsadm.exe command-line tool to back up and to restore Windows SharePoint Services Web sites and personal sites in SharePoint Portal Server 2003
“Important Before you use Stsadm.exe to back up a Windows SharePoint Services site in an active farm, you should lock the site collection. To do this, use the “No Access” lock.“
The administrators guide was updated as well as follows (I’m placing the important parts in bold red):
Backing Up and Restoring Web Sites
“Caution Previous versions of this guide recommended using regular backup operations to allow recovery of single document or list items. This usage is no longer recommended. Because the backup operation involves reading a large amount of data, running the backup process frequently can interfere with the performance of the system, including blocking end users’ access to their sites”
The updated Administrators Guide continues on with the following statements :
Site backup and restore affects performance and can cause access errors.
The process of backing up and restoring sites takes up both memory and processing power on your server. In addition, if you have many sites, or a large amount of data in your sites, the backup process can take a long time, and might result in access errors for your users. If you choose to schedule automatic backups in a batch file or script, be sure to run the backup process when server usage is minimal or, optimally, when there are no users accessing data on your sites.
Site backup and restore are not designed to be used when the server is under active load.
If a site is in use when the backup operation is run, the data in that site may continue to change throughout the operation. The resulting backup file may be inconsistent with the actual state of the site and, if you restore this file, the restored site or database will be inconsistent as well. To avoid possible inconsistencies, lock the site collection prior to backing up a site in an active farm, using the “No Access” lock. After the backup is complete, set the lock back to “Not locked”. For information about locking and unlocking a site collection, see the Managing Locks section of the Configuring Site Collection Quotas and Locks topic.
Therefore, before issuing a STSADM -o backup on a site collection, you have to visit the Manage Qoutas and Locks link in Windows SharePoint Services Central Admin via the browser to lock the site before backing it up.
The problem, is that with Windows SharePoint Services 2.0 and SharePoint Portal Server 2003 there is no automated nor STSADM extension to set the sites lock state prior to backing it up. You must use the Windows SharePoint Services Central Administration UI to set the lock state.
This makes it difficult to automate the backup/restore of site collections through script, and requires manual intervention.
Note: In Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007, there are two new operations in STSADM (getsitelock and setsitelock) that negate the need to visit the Central Admin pages. Therefore you can automate the locking from the command line or script.
To help with this, I just posted SPLSBackup for Windows SharePoint Services 2.0 and SharePoint Portal Server 2003 for general use at the following link:
The purpose of SPLSBackup is to mimic STSADM site collection level backup/restore but with options for setting/unsetting the sites lock state during the operation, therefore eliminating the need to manually visit the SharePoint Central Admin pages before and after.
SPLSBackup Performs a site collection level backup/restore (just as STSADM -o backup/restore) yet locks the site before backing up.
The package at the CodePlex link also contains the source code for SPLSBackup.
The source and included binary build of the tool is provided as is.
This tool can also be used as a reference to understanding the SharePoint Object Model in greater detail. Feel free to tailor it to suit the needs of your environment.
Hope this helps!
– Keith Richie
7 Replies to “Perform non-intrusive Site Collection level backups with SPLSBackup”
Thank you, Thank you, Thank you
We currently have two backup methods for our 2003 environment. One using the standard nightly tape backup and another using stsadm to backup and restore the site to a QA environment. The stsadm method worked when we first launched the solution (not many sites). However, now that we are moving to 2007 I noticed that these jobs were failing because of opened/modified sites during the backup period.
I appreciate you developing an easy to use solution while we migrate to 2007.
Zach Rosenfield wrote a powershell script to do this for WSS 3 / MOSS 2007:
I spent one day building a simple blogs. Could you give me some suggestion?
Je pense que c’est le mensonge.
I’m hoping that you have alerts set up on this blog entry, as it is a fairly old one, but this utility is no longer on CodePlex. Have you a local copy that I can ask you for?
Steven, yes I removed my codeplex projects, as I’m no longer sharing the code. What version of SharePoint is this for?