Using STSADM to Move or Back Up Site Collections


The STSADM utility is a tool that comes installed with Windows SharePoint Services that allows for a great deal of SharePoint functionality. STSADM can import templates, create sites, change settings, and move data. Unlike backing up and moving data with a program such as FrontPage, STSADM must be run from the server that SharePoint is installed on.

CAUTION

Great caution should be taken when using the STSADM utility because it can perform a myriad of tasks in SharePoint, such as deleting sites and modifying database information. Be sure to test your data migration in a lab setting before running it against a production environment.


Backing Up Site Collections with STSADM

To back up a site collection using STSADM, perform the following steps:

1.

From the server that has Windows SharePoint Services installed, open the command prompt by selecting Start, Run and then type cmd.exe into the Open box.

2.

Enter the following into the command-line box:

 cd \Program files\common files\microsoft shared\web server extensions\60\bin 

3.

Enter the following:

[View full width]

stsadm.exe o backup url http://servername/sitecollectionname -filename SiteCollectionBackup.dat overwrite

where servername is the name of your server, and sitecollectionname is the top-level site in a collection, as shown in Figure 19.9.

Figure 19.9. Backing up a site collection using STSADM.


The advantage of backing up a site collection using this technique is that it can be scripted or run from a batch file.

Deleting a Site Collection in Advance of a STSADM Restore

Using the same STSADM utility, you can restore a site collection to the SharePoint server. To do this, however, either you must create a new configuration database (which is what you would do if you were restoring an entire server), or you have to delete the old site collection. After the old site collection is deleted, you can restore the original site data. Unlike with FrontPage or SMIGRATE, you don't have to create a blank site to accomplish this, but the site must be deleted, or the restore will fail.

CAUTION

As always, be sure to run these types of operations in a lab environment before testing in production. You can't be assured of the integrity of the backup, so it is important to check it first before deleting your site.


To delete the original site collection in advance of the restore, use the following procedure:

1.

From the server that has Windows SharePoint Services installed, open the command prompt by selecting Start, Run and then typing cmd.exe in the Open box.

2.

Enter the following into the command-line box:

 cd \Program files\common files\microsoft shared\web server extensions\60\bin 

3.

Enter the following command, as shown in Figure 19.10:

 stsadm.exe o deletesite url http://servername/sitecollectionname 

Figure 19.10. Deleting a site collection in advance of a restore.


where servername is the name of the server, and sitecollectionname is the name of your site collection.

Restoring SharePoint Site Collections Using the STSADM Utility

After the original site collection has been deleted or a new server has been built to replace the old one, you will be ready to restore the site collection using the following procedure:

1.

From the server that has Windows SharePoint Services installed, open the command prompt by selecting Start, Run and then typing cmd.exe into the Open box.

2.

Enter the following into the command-line box:

 cd \Program files\common files\microsoft shared\web server extensions\60\bin 

3.

Enter the following command (see Figure 19.11):

[View full width]

stsadm.exe o restore url http://servername/sitecollectionname -filename SiteCollectionBackup.dat

Figure 19.11. Restoring a site collection.


where servername is the name of your server.

Using this approach is ideal for migrating data or restoring a site because it restores all SharePoint site security and SharePoint list data, and can be scripted to run via batch files.




Microsoft SharePoint 2003 Unleashed
Microsoft SharePoint 2003 Unleashed (2nd Edition) (Unleashed)
ISBN: 0672328038
EAN: 2147483647
Year: 2005
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net