Back up and restore Web applications by using built-in tools (Windows SharePoint Services 3.0)
Applies To: Windows SharePoint Services 3.0
Topic Last Modified: 2009-03-06
You can use the tools that are included with Windows SharePoint Services 3.0 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 Windows SharePoint Services 3.0 compare with other tools for protecting the SharePoint data, see Choose backup and recovery tools (Windows SharePoint Services).
You can back up and restore data for Windows SharePoint Services 3.0 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
On the SharePoint Central Administration Web site, on the Operations page, in the Backup and Restore section, click Perform a backup.
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.
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.
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
On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
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.
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.
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.
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 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 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 (Windows SharePoint Services 3.0).
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
Click Start, and then click Run.
Type notepad, and then click OK.
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.
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.
Use 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.
Click Save.
To schedule a backup
Start the Scheduled Task Wizard, and then click Next.
Click Browse, locate the batch file that you created, and then click Open.
Type a name for your task, for example, backup_batch.
Select how frequently you want this task to be 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.
Determine 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.
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
On the SharePoint Central Administration Web site, on the Operations page, in the Backup and Restore section, click Restore from Backup.
On the Select Backup Location page, in the Backup File Location section, enter the universal naming convention (UNC) path of the backup folder.
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.
On the Select Component to Restore page, select the Web applications that you want to restore, and then click Continue Restore Process.
On the Select Restore Options page:
In the Restore Component section, verify that the Web applications that you selected is displayed.
In the Restore Options section, select Same configuration.
A message is displayed, notifying you that the current farm will be overwritten. Click OK.In the New Names section, type new names and URLs for each component, or accept the default values.
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
On the drive where SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
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.
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.
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.
When you receive a warning that all selected items will be overwritten, type y, and then press ENTER.
When you are prompted, type the user name and password for the Web application and content database.
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.
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 the farm (Windows SharePoint Services 3.0)
Back up and restore the entire farm (Windows SharePoint Services 3.0 technology)
Create a recovery farm (Windows SharePoint Services 3.0)
Back up and restore site collections by using built-in tools (Windows SharePoint Services 3.0)
Back up and restore content databases (Windows SharePoint Services 3.0)
Back up and recover site objects (Windows SharePoint Services)
Back up and restore an item by using DPM (Windows SharePoint Services 3.0)
Back up and restore a site by using DPM (Windows SharePoint Services 3.0)