Sunday, January 18, 2009

Backup and Restore a sharepoint site from 1 pc to another with installed features

In order to backup and restore a sharePoint site say from pc1 to pc2 using command prompt, First open the command prompt in pc1:
start... Run... type cmd... press enter

In the command prompt, type:

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
...press enter

Then run this command to take backup of an existing site:

stsadm -o backup -url http://svradm002:11226/ -filename c:\backUpSite.dat -overwrite
replace the url and file location with the data you need

In Pc2, copy and paste the backupSite.dat file to any location (ex: in c drive). Open command prompt and go to the bin folder in preceding way. Then use this command to restore from a backup to an existing site. Remember, you have to create the site on the following location (http://vpc-wss:30322/) first, then you can restore from the dat file on that site. (Assume that the address of our target site is: http://vpc-wss:30322/)

stsadm -o restore -url http://vpc-wss:30322/ -filename c:\backupSite.dat -overwrite

U will find that the feature is not available with the new site that you created. If you added the feature manually, by creating feature folder, element & manifest file then you have to do again in the new PC. Check my previous blog post. But if you created a feature using Visual Studio with vsewss (visual studio extension for windows sharePoint server) installed, then you have to do this:
-In PC1, open the project folder
-copy the debug folder
-paste it anywhere in pc2
-then edit the setup.bat file inside the debug folder. replace old addresses http://localhost:11226/ with new one: http://localhost:30322/
-then run the setup.bat file.
this will add the feature in the new site.

1 comment:

J said...

How in the world could I be popular there? Haha. I guess because I was just about the only one that even bothered to use the website...