Udostępnij za pośrednictwem


Backup: Stsadm operation (Windows SharePoint Services)

Applies To: Windows SharePoint Services 3.0

 

Topic Last Modified: 2009-04-15

Operation name: Backup

Description

When the url parameter is used, a backup of the site collection is created. However when the backupmethod parameter is used, a backup of an individual database, Web application, or the entire farm can be created. If you want to overwrite an existing backup file for a site collection only, use the overwrite parameter.

Note

The force and nositelock parameters were first introduced in Windows SharePoint Services 3.0 with Service Pack 2 (SP2).

Important

If changes are made to the site collection during the backup process, the backup can become corrupted. Backing up large site collections can take a long time. To reduce the chance that user activity will interfere with a site collection backup, or that the time that is required to back up large site collections will exceed the available maintenance window, follow these recommendations:

  • Do not use the Stsadm backup operation for site collections larger than 15 gigabytes (GB). For larger site collections, see the recommendations in Back up and restore site collections by using built-in tools (Windows SharePoint Services 3.0).

  • For the duration of the backup, set the site collection URL to read-only by using the Setsitelock: Stsadm operation (Windows SharePoint Services). This lets users view content on the site, but prevents activities such as adding or changing content that interfere with the backup process. When the backup is complete, return the access setting of the site collection URL to its default state.

    In Service Pack 2 for SharePoint Products and Technologies, site collections are automatically locked as read-only before a backup process occurs. Therefore, there is no need to use the Setsitelock: Stsadm operation (Windows SharePoint Services) operation. If you do not want site collections to be locked as read-only, you must specify the nositelock parameter that is available in Windows SharePoint Services 3.0 with Service Pack 2 (SP2).

Syntax

For site collection backup

stsadm -o backup

**   -url <URL name>**

**   -filename <file name>**

**\[-nositelock\]**

**\[-overwrite\]**

For catastrophic backup

stsadm -o backup

**   -directory <UNC path or local drive>**

**   -backupmethod <full or differential>**

**\[-force\]**

**\[-item\] \<created path from tree\>**

**\[-percentage\] \<integer between 1 and 100\>**

**\[-backupthreads\] \<integer between 1 and 10\>**

**\[-showtree\]**

**\[-quiet\]**

Parameters

Parameter Value Required? Description

url

A valid URL, such as "http://server_name"

Yes

URL of the site collection that you want to back up

filename

A valid file name for the site collection backup file, such as "Siteb.bak"

Yes

Name of the backup file

nositelock

<none>

No

Specifies that the site collection lock during a site collection backup is not set to read-only.

Note

This parameter was first introduced in Windows SharePoint Services 3.0 with Service Pack 2 (SP2).

overwrite

<none>

No

To overwrite an existing backup file.

directory

Any one of the valid paths:

  • C:\folder_name

  • \\server_name\folder_name

Note

The spbr* folders are automatically created.

Yes

The path where Windows SharePoint Services 3.0 should store the backup package it generates. If you have a computer that has Microsoft SQL Server 2005 and an instance of Windows SharePoint Services 3.0 installed, you can use local drive paths. This would include a basic installation. However, if SQL Server 2005 and Windows SharePoint Services 3.0 are installed on multiple computers, you must use Universal Naming Convention (UNC) share paths so that the SQL database and search components are written to the same location (for example, \\computer_name\volume\Backup).

Multiple backup packages can be stored in the same location. This is the same path that you would pass to the -directory parameter of the stsadm -o restore operation.

backupmethod

Any one of the following:

  • Full

  • Differential

Yes

Type of backup file to be created. The values are full or differential.

A full backup is a backup of all the selected data. A differential backup is a backup of all the selected data that has changed since the last full backup.

force

<none>

No

Ignores the disk space check and proceeds with the backup.

Note

This parameter was first introduced in Windows SharePoint Services 3.0 with Service Pack 2 (SP2).

item

A valid item, such as:

Farm\Windows SharePoint Services

No

Indicates which part of the farm should be backed up. You might use the full farm path notation as displayed by the -showtree parameter or the name of the target component in the path if it has a unique name. If there are multiple items within the same match, the full path must be provided. By default, the top node is selected. Surround the item or path in double quotation marks if it contains a space. If this parameter is absent, the entire farm is backed up.

percentage

An integer value between 1 and 100; the default value is 5

No

Requests backup operation progress updates to be displayed in increments of that percentage (for example, a value of "5" will display backup progress updates at 5 percent completed, and a value of "10" will display backup progress updates at 10 percent completed).

Note

This percentage is not precise and the actual progress updates might be lower or greater than requested.

For a very large database, 1 is the optimal value that you should use to see some updates displayed.

The default value is 5.

backupthreads

An integer value between 1 and 10

No

The number of threads that should be used during the backup. For Windows SharePoint Services, the recommended value is 3 threads.

The default value is 1. The fewer the threads, the easier it is to read and understand the backup log file.

showtree

<none>

No

Displays which objects in the farm will be backed up based on the other parameters passed to the backup operation, namely the -item parameter. Items that will be excluded from the backup based on the other parameters passed to the backup operation will be preceded with an asterisk character (*). Items that cannot be backed up will be enclosed in square brackets ([ ]). A backup will not be performed if the showtree parameter is present.

quiet

<none>

No

Suppresses the output of backup progress information to the display window. The final backup status ("Operation completed successfully.") will still be displayed. If the -quiet parameter is absent, the backup operation will display progress information to the display window as it backs up the package.