Once you’ve sorted out the small matter of finding stsadm.exe in the first place, and installed all the shrapnel that goes in strange places such as the GAC, obscure subdirectories of Program Files, web.config, and so on, you do

stsadm -o backup -url http://mysite/ -filename backup-filename.bak

on server A. This produces a single file containing your site and all the subsites, and you simply copy it over to and do

stsadm -o restore -url http://myothersite/ -filename backup-filename.bak

on server B.

Yes, that’s right, that’s it.

No XML files to edit. No permissions to set. No convoluted database options to put in. No failed previous attempts to delete from all over the place.

Just the backup filename and the URL, and you’re done.

The only thing I found was that for some reason I needed to create an empty web application and a site collection first, and restore on top of that using the -overwrite option of stsadm.exe, but apart from that, it worked perfectly. So perfectly, in fact, that we had to triple check that it hadn’t missed anything out or come up with some other strange gotchas.

Come on Microsoft, if you can make the command line option that straightforward, how come the web based version is such a minefield?!

[Update: It turns out that there is one particular permission issue that you need to watch out for. When you are restoring a backup onto an already existing site collection, you need to make sure that you are running stsadm.exe as a site collection administrator. Apart from that, it’s quite straightforward.]

Advertisements