How to use:
In command prompt, go to this directory:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
and then use either of the following commands:
Backup and Restore Site
>> to backup a site collection
stsadm -o backup -url <site collection url> -filename <name of the backup file>
example: to backup sitecollection1 and save the backup file to drive C:
stsadm -o backup -url "http://www.vpc.com/sites/sitecollection1" -filename "C:\sitecollection1.bak"
>> to restore a site collection
stsadm -o restore -url <site collection url> -filename <name of the backup file>
example: to restore sitecollection1 into a new site collection:
stsadm -o restore -url "http://www.abc.com/sites/newsitecollection" -filename "C:\sitecollection1.bak"
Import and Export Subsite
>> to export a subsite
stsadm -o export -url <subsite url> -filename <name of the backup file>
example:
stsadm -o export -url "http://www.vpc.com/log" -filename "C:\vpclog.bak"
>> to import a subsite
stsadm -o import -url <subsite url> -filename <name of the backup file>
example:
stsadm -o import -url "http://www.abc.com/log" -filename "C:\vpclog.bak"
SetSiteLock
>> to lock the site collection as read-only:
stsadm -o setsitelock -url <site collection url> -lock readonly
example:
stsadm -o setsitelock -url http://www.vpc.com -lock readonly
>> to unlock the site collection:
stsadm -o setsitelock -url <site collection url> -lock none
example:
stsadm -o setsitelock -url http://www.vpc.com -lock none
Install / Uninstall & Activate / Deactivate Feature
>> to deactivate feature
stsadm -o deactivatefeature -filename < path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder> -url <site url> -force
example:
stsadm -o deactivatefeature -filename "DomainRequestTaskWFCT\Feature.xml" -url http://www.abc.com -force
>> to uninstall feature
stsadm -o uninstallfeature -filename <path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder > -force
example:
stsadm -o uninstallfeature -filename "DomainRequestTaskWFCT\Feature.xml" -force
>> to install feature
stsadm -o installfeature -filename <path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder > -force
example:
stsadm -o installfeature -filename "DomainRequestTaskWFCT\Feature.xml" -force
>> to activate feature
stsadm -o activatefeature -filename < path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder> -url <site url> -force
example:
stsadm -o activatefeature -filename "DomainRequestTaskWFCT\Feature.xml" -url http://www.abc.com -force
stsadm -o import -url "http://www.abc.com/log" -filename "C:\vpclog.bak"
SetSiteLock
>> to lock the site collection as read-only:
stsadm -o setsitelock -url <site collection url> -lock readonly
example:
stsadm -o setsitelock -url http://www.vpc.com -lock readonly
>> to unlock the site collection:
stsadm -o setsitelock -url <site collection url> -lock none
example:
stsadm -o setsitelock -url http://www.vpc.com -lock none
Install / Uninstall & Activate / Deactivate Feature
>> to deactivate feature
stsadm -o deactivatefeature -filename < path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder> -url <site url> -force
example:
stsadm -o deactivatefeature -filename "DomainRequestTaskWFCT\Feature.xml" -url http://www.abc.com -force
>> to uninstall feature
stsadm -o uninstallfeature -filename <path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder > -force
example:
stsadm -o uninstallfeature -filename "DomainRequestTaskWFCT\Feature.xml" -force
>> to install feature
stsadm -o installfeature -filename <path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder > -force
example:
stsadm -o installfeature -filename "DomainRequestTaskWFCT\Feature.xml" -force
>> to activate feature
stsadm -o activatefeature -filename < path of the Feature.xml file relative to the 12\TEMPLATE\FEATURES folder> -url <site url> -force
example:
stsadm -o activatefeature -filename "DomainRequestTaskWFCT\Feature.xml" -url http://www.abc.com -force