Tuesday 2 August 2011

STSADM Commands in MOSS2007

STSADM tool is used for command-line administration of Office SharePoint Server 2007. Stsadm is usually located at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN" and the user must have Administrative rights to use this tool. This tool provides access to the complete set of operations on the SharePoint Server 2007.

STSADM proves to be a boon when used with SharePoint migration tasks. One can easily carry out the IMPORT / EXPORT and BACKUP / RESTORE operations. The commands for these operations are listed below:

BACKUP:

stsadm.exe -o backup -url [site collection url] -filename D:\sitebackup\filename.bak

If the same file name is exist in the same location , then you have use the -overwrite command to overwrite the existing file with same name.

stsadm.exe -o backup -url [site collection url] -filename D:\sitebackup\filename.bak -overwrite

RESTORE

stsadm.exe -o restore -url [site collection url] -filename D:\sitebackup\filename.bak -overwrite

EXPORT

stsadm.exe -o export -url [site collection url] -includeusersecurity -nofilecompression -filename D:\sitebackup

IMPORT

stsadm.exe -o import -url [site collection url] -includeusersecurity -nofilecompression -filename D:\sitebackup

Note: D:\sitebackup\filename.bak and D:\sitebackup is just an example of a physical location used to generate / consume the file

To determine the lock status of the site, you can use the following getsitelock syntax:

stsadm -o getsitelock -url http://server_name/

Once the lock status of the site collection is determined, you can use the noaccess parameter of the setsitelock operation to lock out all users to the site:

stsadm -o setsitelock -url http://server_name/ -lock noaccess

After the site has been backed up, you can use the none parameter of the setsitelock operation to remove all locks to the site:
stsadm -o setsitelock -url http://server_name/ -lock none

No comments:

Post a Comment