Monday, March 14, 2011

SharePoint stsadm scheduled backup

You can and should use the SQL server to backup the databases.

But its slow and annoying to get it to restore. Also you get issues if you did not mark the content db's for the move. And even more tiresome is if the dev/qa/live are differnetly named and so on.

Instead stsadm will give you the site collection backup, which is a million times faster than going through a dba.

Make a scheduled task in windows scheduler. make a .bat file, add this:

cd "c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
stsadm -o getsitelock -url
stsadm -o setsitelock -url -lock readonly
stsadm -o backup -url -filename "D:\xxx\xxx.dat" -overwrite
stsadm -o setsitelock -url -lock none

Note that you need the site locks, or else the backup will break.

No comments: