Microsoft Windows SharePoint Services
HomeBackForwardPrint

Show AllShow All

Back up or restore a site

Back up or restore a site

Back up a site

Use the Stsadm.exe command-line tool to backup or restore a site. The Stsadm.exe tool takes the following parameters.

Parameter Required? Description
-filename Yes Name of the backup file. For example, backup.dat
-url Yes URL of the Web site. For example, http://server_name/site
-overwrite No Overwrite any existing backup file or Web site. If you do not specify this parameter and a backup file or Web site exists, the backup stops.

The -filename parameter can take any of the following types of information:

Note  Before backing up sites, it is recommended that you generate a list of sites and identify which sites to back up. To generate a list of sites on your server, you can use the enumsites operation. Generating a list of sites by using the enumsites command can help when automating backups. For example, you can include enumsites in the batch file, parse the list of sites, and then use the list of sites to create the backups. The enumsites operation uses the following syntax: stsadm.exe -o enumsites -url url

To perform a simple backup of a site, use the following syntax:

stsadm.exe -o backup -url http://server_name/site -filename file_name.dat

To back up a site and overwrite an existing backup file, use the following syntax:

stsadm.exe -o backup -url http://server_name/site -filename local_drive:\path_name\file_name.dat -overwrite

Restore a site

To restore a site, you use the restore operation with the Stsadm.exe command-line tool. The restore operation takes the following parameters:

Parameter Required? Description
-filename yes Name of the backup file. For example, backup.dat
-url yes URL of the Web site. For example, http://server_name/site
-overwrite no Overwrite any existing backup file or Web site. If you do not specify this parameter and a backup file or Web site exists, the restore operation stops.

You have three options for restoring sites from a backup.

To restore a site from a backup file, either to a new site or a separate server, use the following syntax:

stsadm.exe -o restore -url http://server_name/site -filename file_name.dat

To restore a site from a backup file on a server share, and to overwrite any existing site at the new location, use the following syntax:

stsadm.exe -o restore -url http://server_name/site -filename \\share\folder\file_name.dat -overwrite

Restoring Sites in Active Directory Account Creation Mode

When restoring a site that was running in Active Directory account creation mode, the destination site must also be running in Active Directory account creation mode. Further, you cannot restore a site that was not running in Active Directory account creation mode to a server that is running in Active Directory account creation mode.

Important  

Related Topic

About managing unused site collections
©2003 Microsoft Corporation. All rights reserved.