Thursday, February 11, 2010

backup moss 2007 (sharepoint site) using command prompt

Suppose need to take the back up of an application developed in sharepoint(moss 2007). Taking back up using central admin will not work certain time. There is another option to take the back up and restore it using command prompt
If you want to restore the back up, first create one top level site and remember its URL :) say http://test1.com
Then take the back up of existing site using commnd prompt and take the bin directory using command. I installed sharepoint server in C drive
cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

Now we are inside bin folder
then run the command to take the backup
stsadm -o backup -url http://test2.com -filename "D:\\test2.bkp"
then a message will come "Operation Succesful"

Now we need to restore the backed up site "test2.com" in http://test1.com
Simple, don't leave from command prompt and make sure you are inside bin directory
then run the command to restore back up
stsadm -o restore -url http://test1.com -filename "D:\\test2.bkp"
then a message will come "Operation Succesful"
Enjoy,
Geogy