Tuesday, 14 August 2007

Using STSADM to backup and restore sites

To perform a simple backup of a site, use the following syntax:
stsadm.exe -o backup -url http://server_name/site -filename file_name.dat
To back up a site and overwrite an existing backup file, use the following syntax:
stsadm.exe -o backup -url http://server_name/site -filename local_drive:\path_name\file_name.dat -overwrite

Simply follow the following steps to restore the site:

1. Goto to Central Administration on the server the site is to be restored to.
2. Create a new web application to restore the site to (note the url for step 5)
3. Copy the backup file from where ever you saved it to the server
4. At the command prompt goto "c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
5. run the following command:stsadm -o restore "http://url" -filename "C:\backupup.bak"
6. Go back to central adminsistration.
7. Goto "Site Collection Administrators"
8. Click on "change site collection" & choose the web application based on http://url
9. Add the approprate administrator accounts based on the domain (eg. in username)
10. Reset IIS
11. Visit the site http://url

No comments: