Thursday, June 5, 2008

Backup and Restore

We are in the middle of a server migration so I thought I would share some commands for backup and restoring sites.

Commands for backup:

1. For top level sites and subsites.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o export -url
http://.... –filename ...... -includeusersecurity.

2. Only for top level website.
c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o backup -url
http://.... –filename ......

3. Catastrophic backup of a web application.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o backup -directory \\.... –backupmethod full –item ”web application name(sharepoint - 80)”

4. Catastrophic backup of the entire farm.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o backup -directory \\.... –backupmethod full

5. Attach a content database:

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o addcontent db -url
http://.... –databaseserver……. -databasename ........

Commands for restore:

1. For top level sites and subsites.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o import -url
http://.... –filename ...... -ncludeusersecurity.

2. Only for top level website.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o restore -url
http://.... –filename ......

3. Catastrophic restore of a web application.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o restore -directory \\.... –restoremethod new –backupid ………….

4. Catastrophic restore of the entire farm.

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin>
stsadm -o restore -directory \\.... –restoremethod new

No comments: