STSADM Backup/Restore


Often there is a need to copy a site collection in SharePoint from either one server to another, or to back it up before making some big changes, or maybe even just a desire to duplicate the site collection for testing purposes.

There are a whole slew of ways to do this, but I will recommend the simplest and most successful approach (in my experience). That is the STSADM command for backing up site collections, and the STSADM command for restoring site collections.

Backup a Site Collection

  1. On your SharePoint server hit WINDOWS + R.
  2. Type “cmd” and click OK.
  3. In the cmd window navigate to the “C:\Program files\common files\microsoft shared\web server extensions\12\bin” directory.
  4. Type stsadm -o backup -url “http://theurlofthesitecollection” -filename “C:\MyFirstBackup.bak” -overwrite
  5. Press Enter

    When the backup is completed it will now be sitting in your C:\ with the name MyFirstBackup.bak.

At this point you can copy the file to the other server, or just perform the restore on the same server by following the steps below.

Note before restoring ensure that the target site collection you are restoring onto is a BLANK site. This will allow you to avoid some potential issues with duplicate names and ID’s.

To Restore a Site Collection

  1. On your SharePoint server hit WINDOWS + R.
  2. Type “cmd” and click OK.
  3. In the cmd window navigate to the “C:\Program files\common files\microsoft shared\web server extensions\12\bin” directory.
  4. Type stsadm -o restore -url “http://theurlofthetargetsitecollection” -filename “C:\MyFirstBackup.bak” -overwrite
  5. Press Enter

When the restore is complete the site collection should now be replicated, or restored.

Keep in mind this is a pretty fast method. However it is not the ONLY or BEST meethod for backing up. It’s only my recommendation for something fast to migrate site collections, etc.

For more inforamtion on the limitations of each backup method and advantages see this wonderful TechNet Article: http://technet.microsoft.com/en-us/library/cc287880(TechNet.10).aspx

Thank you,
Richard

Advertisements
Explore posts in the same categories: Administration, SharePoint 2007

Tags: , , ,

You can comment below, or link to this permanent URL from your own site.

One Comment on “STSADM Backup/Restore”

  1. sina Says:

    Hi Richard,
    This post was very useful.Thanks!!But i felt to point out something. In cmd while navigating to the defined folder, the quotes are not required for mentioning the URL of the site collection. I tried the same thing but it showed some error when i removed the quotes the operation was completed successfully. Does that sound odd? Anyways very thankful to you!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: