How to schedule MOSS 2007 backup

MOSS 2007 doesn't provide scheduling for backup.You can schedule backup following these steps.
1. Set path of stsadm.exe
My computer -> Right click ->properties-> Advanced ->Environment Variables->system variable ->select “path” -> click edit
Put ; after existing path and give path of stsadm.exe Generally it is
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\
Click ok, type stsadm in command prompt you should be able to access it without having to go through the trouble of navigating to the SharePoint BIN folder.
We will use following command to perform backup
stsadm.exe -o backup -directory "\\Backup Folder " -backupmethod full -item "Farm" –overwrite

2. If your database server is different from MOSS server then you need to
>> share backup folder in MOSS Server and give folder write access to the user that runs backup command and that has permission to run other sharepoint services.
>> Verify that the MSSQLServer service on database server is started under a domain account that has write access to both the Server share and its underlying partition. Click here to configure domain account in Sql server services.

3. Assuming your backup folder is c:\backup and your MOSS server name is “server” then create a batch file and type following
------------------------------------------------------------------------------------
cd\
cd C:\backup
rd %date:~10,4%-%date:~4,2%-%date:~7,2% /s/q
md %date:~10,4%-%date:~4,2%-%date:~7,2%
stsadm.exe -o backup -directory "\\server\Backup\%date:~10,4%-%date:~4,2%-%date:~7,2%" -backupmethod full -item "Farm" –overwrite
------------------------------------------------------------------------------------
It will create date wise folder (yyyy-MM-dd) and put backup in it.
change folder path in batch file as per your requirement.

4. Run batch file to confirm everything is okay. If you get following error:
Error: Object SharePoint_Config failed in event OnBackup. For more information, see the error log located in the backup directory. SqlException: Cannot open backup device '\\server\backup\spbr0001\0000001.bak'. Operating system error 5(error not found).
Then configure sql server services to domain account. Click here to see it.

5. For Scheduling:
>> open control panel -> Scheduled Tasks ->Add scheduled Task
>> Select batch file and schedule type – daily
>> Give time
>> Enter user info
>> Click finish

No comments:

Post a Comment