Back up & Restore a farm by using the Stsadm command-line tool
Back up a server farm by using the Stsadm command-line tool
1. On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
2. Type the following command, and then press ENTER:
stsadm -o backup -directory <\\server name\folder name>-backupmethod full
If the backup does not complete successfully, review the spbackup.log file.
Automate or delay backup of your farm
Create a batch file
1. Click Start, and then click Run.
2. Type notepad, and then click OK.
3. In Notepad, type the following text:
@echo off echo===========================================================
echo Back up the farm to C:\backup
echo ===============================================================
cd %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\BIN @echo off
stsadm.exe -o backup -directory "\backup" -backupmethod full
echo completed
4. Note :Change "C:\backup" and "\backup" to the name of your backup shared folder.
5. In Notepad, on the File menu, click Save As.
6. In the Save As box, select the folder where you want to keep your batch file.
7. Using the ".bat" file name extension, type the name of the file in the File name box, for example,backup_batch.bat.
8. In the Save as type box, click All files.
9. Click Save.
Schedule a backup
10. Start the Scheduled Task Wizard, and then click Next.
11. Click Browse, navigate to the batch file that you just created, and then click Open.
12. Type a name for your task, for example,backup_batch.
13. Select how often you want this task performed (for example, weekly), and then click Next.
14. To automatically perform this backup periodically, select an interval such as Weekly or Monthly. To perform this backup one time, or to delay a single backup, select One time only.
15. Choose a time and start date for your backup.
16. Type a name and password for a user, and then clickNext. This task will run as if it were started by that user.
17. Click Finish.
To configure advanced settings for the task, select theOpen advanced properties for this task when I click Finish check box in the final page of the wizard. This opens the properties dialog box for the task when you click Finish. You can then change the program being run on the Task tab, fine-tune the schedule on theSchedule tab, customize settings on the Settings tab, or set user and group permissions on the Security tab.
Restore a server farm by using the Stsadm command-line tool
1. On the drive on which SharePoint Products and Technologies is installed, at a command prompt, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
2. To obtain the backup GUID for the specific backup that you want to restore, type the following command, and then press ENTER:
stsadm -o backuphistory -directory
where Path is the Universal Naming Convention (UNC) path to the shared folder that contains the backup.
3. Type the following command, and then press ENTER:
stsadm -o restore -directory -backupid -restoremethod overwrite
where Path is the UNC path to the backup shared folder and GUID from backuphistory is the GUID of for the specific backup package that you want to restore. By using the overwrite value for the–restoremethod parameter, you are directing the old farm to be overwritten by the restored one. When you receive a warning that all selected items will be overwritten, type y and then press ENTER.
4. When prompted, type the user name and password for the Web application and content databases.
5. If the recovery completes successfully, the command window displays the following text:
Completed with 0 warnings.
Completed with 0 errors.
Restore completed successfully.
Operation completed successfully.
6. If the recovery does not complete successfully, refer to the sprestore.log file.