Back up a farm by using the Stsadm command-line tool (Office SharePoint Server 2007)
Updated: June 25, 2009
Applies To: Office SharePoint Server 2007
Before you perform these procedures:
Be sure that you have read and understand the requirements described in Back up a farm by using built-in tools (Office SharePoint Server 2007).
Confirm that you are logged on to the server that is running the SharePoint Central Administration Web site.
Back up a farm by using the Stsadm command-line tool
To run the Stsadm command-line tool, you must be a member of the Administrators group on the local computer.
Back up a server farm by using the Stsadm command-line tool
On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
Type the following command, and then press ENTER:
stsadm -o backup -directory <\\server name\folder name> -backupmethod full
If the backup completes successfully, the command window displays the following text:
Completed with 0 warnings. Completed with 0 errors. Backup completed successfully. --------------------------------------------------------- Operation completed successfully.
If the backup does not complete successfully, review the spbackup.log file.
For more information, see <Technical reference topic for this Stsadm operation>.
Schedule or delay backups
It is not possible to schedule backups from the SharePoint Central Administration Web site. There is no operation that enables you to automate backups by using the Stsadm command-line tool. You can, however, automate the process by creating a batch file and then using Task Scheduler in Microsoft Windows Server 2003 to run the batch file at a specific time. Because performance can be affected when doing backups with the Office SharePoint Server 2007 built-in tools, you might want to schedule your backups for off-peak times such as at night or on weekends.
Use this procedure to create a batch file that will run a full backup of your Office SharePoint Server 2007 server farm. This procedure assumes that you have already created a shared folder for your backups. For more information about how to create a shared folder, see Prepare to back up and restore a farm (Office SharePoint Server 2007).
Automate or delay backup of your farm
To run the Stsadm command-line tool, you must be a member of the Administrators group on the local computer. When using Task Scheduler, ensure that the system date and time on your computer are accurate. To verify or change this information, double-click the time indicator on the taskbar.
Create a batch file
Click Start, and then click Run.
Type notepad, and then click OK.
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
Change "C:\backup" and "\backup" to the name of your backup shared folder.
In Notepad, on the File menu, click Save As.
In the Save As box, select the folder where you want to keep your batch file.
Using the ".bat" file name extension, type the name of the file in the File name box, for example, backup_batch.bat.
In the Save as type box, click All files.
Schedule a backup
Start the Scheduled Task Wizard, and then click Next.
Click Browse, navigate to the batch file that you just created, and then click Open.
Type a name for your task, for example, backup_batch.
Select how often you want this task performed (for example, weekly), and then click Next.
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.
Choose a time and start date for your backup.
Type a name and password for a user, and then click Next. This task will run as if it were started by that user.
To configure advanced settings for the task, select the Open 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 the Schedule tab, customize settings on the Settings tab, or set user and group permissions on the Security tab.