So running an stsadm command to backup a content database is not difficult in a WSS 3.0 or SharePoint 2007 environment. However, there are some other additional steps you should take when doing these backups which I have outlined here.
1. Run “stsadm -o setsitelock” with the “-lock” parameter of either “readonly” or “noaccess”
This ensures no changes are made to the database while backing it up.
2. Run “stsadm -o preparetomove”
This breaks the relationship between the database and the SSP. This allows a new/updated relationship to be established with this database and any SSP, as needed, when it is restored. This allows you to avoid the dreaded error message “Failure to synch web application <guid>: A duplicate site ID…”
3. Run “stsadm -o backup”
No explanation needed.
4. Run “stsadm -o sitelock” with the “-lock” parameter of “none”
This removes all locks on the database after the backup so changes can be made again.
Please see TechNet or “stsadm -help” for detailed instructions on all parameters needed to run these commands.
UPDATE (May 2008): If you would like more information about why I make the recommendation about preparetomove or you are having the sync issue and need a way to resolve, see this blog post.
Jd,
I think that link is broken on your site.
This is the link
http://blogs.technet.com/corybu/archive/2007/06/01/detaching-databases-in-moss-2007-environments.aspx
He had changed the URL of the blog post. I have updated the link. Thanks!