At a command prompt on the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
To determine the current access level of the site, type the following command, and then press ENTER: stsadm -o getsitelock -url<URL name>
where URL name is the URL of the site collection that you want to back up. For more information, see Getsitelock: Stsadm operation (Office SharePoint Server).
If the current access level allows changes to the site content, change it to read-only by typing the following command, and then pressing ENTER: stsadm -o setsitelock -url<URL name>-lock readonly
where URL name is the URL of the site collection that you want to back up. For more information, see Setsitelock: Stsadm operation (Office SharePoint Server).
When the backup is complete, use this procedure to return access to the site collection to the original setting determined in step 1.
Use this procedure to back up a site collection by using the Stsadm command-line tool.
Examples
A common situation where the getsitelock and setsitelock operations are useful is when a site is backed up. Typically, before you back up a site collection, the site should be locked and no users should have access to it.
To determine the lock status of the site, you can use the following getsitelock syntax: stsadm -o getsitelock -url http://server_name
Once the lock status of the site collection is determined, you can use the noaccess parameter of the setsitelock operation to lock out all users to the site: stsadm -o setsitelock -url http://server_name -lock noaccess
You can use the Backup operation to create a backup of the site collection: stsadm -o backup -url http://server_name -filename "filename.bak" -overwrite
After the site has been backed up, you can use the none parameter of the setsitelock operation to remove all locks to the site: stsadm -o setsitelock -url http://server_name -lock none