Share via


Back up and restore Web applications by using built-in tools (Office SharePoint Server 2007)

Applies To: Office SharePoint Server 2007

This Office product will reach end of support on October 10, 2017. To stay supported, you will need to upgrade. For more information, see , Resources to help you upgrade your Office 2007 servers and clients.

 

Topic Last Modified: 2016-11-14

You can use the tools that are included with Microsoft Office SharePoint Server 2007 to back up and restore Web applications. The Central Administration Web site offers a simple, UI-based method to manage content backup and recovery and also to view job history and status. The Stsadm command line tool offers a faster and more flexible command line-based approach to content backup and recovery. You can use the Stsadm command-line tool together with Windows Scheduler to schedule delayed or periodic backups.

For more information about how the data protection tools that are included with Office SharePoint Server 2007 compare with other tools for protecting the SharePoint data, see Choose backup and recovery tools (Office SharePoint Server).

You can back up and restore data for Office SharePoint Server 2007 by using any of the following methods.

Back up Web applications by using SharePoint built-in tools

Use this procedure to back up a Web application by using the SharePoint Central Administration Web site.

Important

Membership in the Farm Administrators SharePoint group is the minimum that you must have to complete this procedure.

To back up a Web application by using the user interface

  1. On the SharePoint Central Administration Web site, on the Operations page, in the Backup and Restore section, click Perform a backup.

  2. On the Select Component to Backup page, select the check boxes for the Web applications that you want to back up. The check boxes for any subordinate Web applications and content databases are automatically selected. Click Continue to Backup Options.

  3. On the Select Backup Options page, a differential backup backs up data that is created or changed since the last backup. If you are performing a combination of full and differential backups, the recovery process requires that you have the last full backup and the last differential backup.

    • In the Backup Content section, verify that the Web applications that you selected is displayed.

    • In the Type of Backup section, select Full.

    • In the Backup File Location section, type the UNC pat the backup folder.

  4. Click OK.

    You can view the backup job status on the back up status page by clicking Refresh. The page also refreshes every 30 seconds automatically. Backup and recovery is a Timer service job, which may take few seconds for the backup to start.

    If you receive any errors, you can find more information by looking in the spbackup.log at the UNC path you specified earlier.

Use this procedure to back up a Web application by using the Stsadm command-line tool.

Important

Membership in the Administrators group on the local computer is the minimum required to complete this procedure.

To back up a Web application by using the command line

  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. If you do not already know what node you want to back up, type the following command:

    stsadm –o backup –showtree

    Note

    Items enclosed by square brackets ([ ]) cannot be directly selected for backup but are backed up when their parent item is selected.

  3. To back up a Web application, type the following command:

    stsadm -o backup -directory <\\server name\folder name> -backupmethod full -item <Web application name>

    where \\server name\folder name is the UNC path of the backup folder and where Web application name is the name of the Web application that you want to back up. You might use the full farm path notation as displayed by the showtree parameter or the name of the component in the path if it has a unique name — for example, Windows SharePoint Services Web Application\SharePoint-80.

  4. If the backup is completed successfully, the Command Prompt window displays the following text:

    Completed with 0 warnings.
    Completed with 0 errors.
    Backup completed successfully.
    ---------------------------------------------------------
    Operation completed successfully.
    
  5. If there are errors or warnings, or if the backup is not completed successfully, review the spbackup.log file in the folder that you specified in step 3.

Schedule or delay backups

You cannot schedule backups from the SharePoint Central Administration Web site. However, you can automate the process by creating a batch file and then by using Task Scheduler in 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 the Web application. 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).

Tip

When you use Task Scheduler, make sure 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.

To 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 sites for the farm to C:\backup
    echo ===============================================================
    cd \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
    @echo off
    stsadm -o backup -directory <\\server name\folder name> -backupmethod full -item <Web application name> 
    echo completed
    

    where \\server name\folder name is the UNC path of the backup folder and where Web application name is the name of the Web application that you want to back up. You might use the full farm path notation as displayed by the showtree parameter or the name of the component in the path if it has a unique name — for example, Windows SharePoint Services Web Application\SharePoint-80.

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

To schedule a backup

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

  2. Click Browse, locate the batch file that you created, and then click Open.

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

  4. Select how frequently you want this task to be 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. Determine 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.

Restore SharePoint Web applications by using built-in tools

Use this procedure to restore a SharePoint Web application by using the built-in tools.

Important

Membership in the Farm Administrators SharePoint group is the minimum that is required to complete this procedure.

To restore a Web application by using the user interface

  1. On the SharePoint Central Administration Web site, on the Operations page, in the Backup and Restore section, click Restore from Backup.

  2. On the Select Backup Location page, in the Backup File Location section, enter the universal naming convention (UNC) path of the backup folder.

  3. On the Select Backup Package to Restore page, select the backup file that you want to use to restore, and then click Continue Restore Process.

  4. On the Select Component to Restore page, select the Web applications that you want to restore, and then click Continue Restore Process.

  5. On the Select Restore Options page:

    1. In the Restore Component section, verify that the Web applications that you selected is displayed.

    2. In the Restore Options section, select Same configuration.
      A message is displayed, notifying you that the current farm will be overwritten. Click OK.

    3. In the New Names section, type new names and URLs for each component, or accept the default values.

  6. Click OK.

Use this procedure to restore a Web application by using the Stsadm command-line tool.

Important

Membership in the Administrators group on the local computer is the minimum required to complete this procedure.

To restore a Web application by using the command line

  1. On the drive where SharePoint Products and Technologies is installed, 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 <UNC path>

    where UNC path is the path of the shared folder that contains the backup.

  3. If you do not already know the name of the Web applications that you want to restore, type the following command, and then press ENTER:

    stsadm –o restore –showtree -directory <UNC path> -backupid <GUID from backuphistory>

    where UNC path is the path of the path to the shared folder that contains the backup and where GUID from backuphistory is the GUID of the backup package that you want to restore.

    Note

    Items enclosed by square brackets ([ ]) cannot be restored.

  4. To restore a Web application, type the following command, and then press ENTER:

    stsadm -o restore -directory <UNC path> -backupid <GUID from backuphistory> -item <created path from tree> -restoremethod overwrite

    where UNC path is the UNC path of the backup shared folder, GUID from backuphistory is the GUID for the specific backup package that you want to restore, and created path from tree is the full farm path notation as displayed by the -showtree parameter.

  5. When you receive a warning that all selected items will be overwritten, type y, and then press ENTER.

  6. When you are prompted, type the user name and password for the Web application and content database.

  7. If the recovery is completed successfully, the Command Prompt window displays the following text:

    Completed with 0 warnings.
    Completed with 0 errors.
    Restore completed successfully.
    ---------------------------------------------------------
    Operation completed successfully.
    
  8. If the recovery is not completed successfully, you receive the following message:

    The restore job failed. For more information, see the error log that is located in the backup directory. 
    

    The referenced error log will be the sprestore.log file in the backup shared folder.

See Also

Concepts

Back up and restore a farm (Office SharePoint Server 2007)
Back up and restore an entire farm (Office SharePoint Server 2007)
Create a recovery farm (Office SharePoint Server 2007)
Back up and restore site collections by using built-in tools (Office SharePoint Server 2007)
Back up and restore databases (Office SharePoint Server)
Back up and restore SSPs (Office SharePoint Server 2007)
Back up and restore SSO (Office SharePoint Server 2007)
Back up and restore My Sites by using built-in tools (Office SharePoint Server 2007)
Back up and restore InfoPath forms by using built-in tools (Office SharePoint Server 2007)
Back up and restore an item by using DPM (Office SharePoint Server)
Back up and restore a site by using DPM (Office SharePoint Server)