Backup: Stsadm operation (Office SharePoint Server)
Updated: April 28, 2009
Applies To: Office SharePoint Server 2007
Updated: 2009-04-28
Operation name: Backup
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 Microsoft Office SharePoint Server 2007 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:
|
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.
|
||
|
overwrite |
<none> |
No |
To overwrite an existing backup file. |
||
|
directory |
Any one of the valid paths:
|
Yes |
The path where Microsoft Office SharePoint Server 2007 should store the backup package it generates. If you have a computer that has Microsoft SQL Server 2005 and an instance of Office SharePoint Server 2007 installed, you can use local drive paths. This would include a basic installation. However, if SQL Server 2005 and Office SharePoint Server 2007 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:
|
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.
|
||
|
item |
A valid item, such as: Web Application\SharePoint-80 |
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).
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. |
- 5/22/2009
- Suprej Venkat
- 2/23/2010
- Mark Vogt
The KB verbiage states that:
"However when the backupmethod parameter is used, a backup of an individual database, Web application, or the entire farm can be created.".
This is less-than-correct.
To be as clear as possible, the text should read like this:
The backup command is powerful, and capable of creating backups of individual site collections, complete databases, whole web applications and even complete farms.
When the -url parameter is used, a backup of a complete site collection can be created.
When the -item parameter is used, a backup of an individual (content) database, individual web application, or even the entire SharePoint farm can be created."
BEST PRACTICE:
1. USE STSADMWin (the popular GUI-based skin around STSADM.exe);
2. CHOOSE the correct form of the backup command (STSADMWin lists 3) for your purposes (say you want to backup a content database);
3. PROVIDE the required parameters -directory (location for your backup, say "\\LAB-APP-VMOSS\D$\SharePoint_Backups" ) and -backupmethod (say "full")
4. PROVIDE the optional (but terrible useful) parameters:
- item : leave blank for now (you'll see why in a moment);
- percentage: 10 (progress will update display only at 10% increments - e.g. "10% complete..... 20% complete..... 30% complete... ")
- backupthread: 3 (this is the default, and works fine);
- showtree: CHECKED (running the command in this mode will first print a [not-actual-backup] cool 'shopping list' of the entire farm hierarchy, from which you will then PICK what you want to backup!);
5. RUN the command
=> stsadm creates a cool hierarchical output showing what you WILL get backed-up IF you UN-check the "showtree" checkbox
6. ADJUST the value (path) you put in the -edit parameter field (e.g. "Farm\Windows SharePoint Services Web Application\Sharepoint - 30301\WSS_Content_30301\")
7. RE-RUN the command with -showtree STILL CHECKED
8. CONFIRM the output tree IS the way you WANT/EXPECT it to be (basically all the nodes in the tree will either be in [] (you can't select it), or have a * in front (not selected).... EXCEPT for YOUR content database, which will have NOTHING in front of its line in the hierarchy;
9. RUN the command with he -showtree now UN-CHECKED
=> you will get output, status updates, a "Backup completed successfully" final message... and eventually a nice (set of) backup files (of the content database) as .bak, .log and .xml files in the directory you've selected
Cheers,
-MV
Note:
Important: