Share via


Back up a farm by using the Stsadm command-line tool (Windows SharePoint Services 3.0)

Applies To: Windows SharePoint Services 3.0

 

Topic Last Modified: 2009-06-22

Before you perform these procedures:

Back up a farm by using the Stsadm command-line tool

Important

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

  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 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 Windows SharePoint Services 3.0 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 Windows SharePoint Services 3.0 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 (Windows SharePoint Services 3.0).

Automate or delay backup of your farm

Tip

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

  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
    

    Note

    Change "C:\backup" and "\backup" to the name of your backup shared folder.

  4. In Notepad, on the File menu, click Save As.

  5. In the Save As box, select the folder where you want to keep your batch file.

  6. Using the ".bat" file name extension, type the name of the file in the File name box, for example, backup_batch.bat.

  7. In the Save as type box, click All files.

  8. Click Save.

Schedule a backup

  1. Start the Scheduled Task Wizard, and then click Next.

  2. Click Browse, navigate to the batch file that you just created, and then click Open.

  3. Type a name for your task, for example, backup_batch.

  4. Select how often you want this task performed (for example, weekly), and then click Next.

  5. 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.

  6. Choose a time and start date for your backup.

  7. Type a name and password for a user, and then click Next. This task will run as if it were started by that user.

  8. Click Finish.

    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.

See Also

Concepts

Back up a farm by using built-in tools (Windows SharePoint Services 3.0)
Back up a farm by using Central Administration (Windows SharePoint Services 3.0)