Tuesday 11 November 2014

SharePoint Site Backup and Restore

Backup the site using the following STSADM Command:
Stsadm –o backup –url http://: -filename

Example:
Stsadm –o backup –url http://vanillargk:5555 –filename "e:\backup5555.bak"
Create a new Web Application for restoring the site:
Go to Central Administration -> Application Management -> under SharePoint Web Application Management -> click Create or Extend Web Application. Fill in the required information, click Ok and wait until the progress continues.
Once the new web application is created, run the following STSADM command and restore the site using the backup file created above.
Stsadm –o restore –url http://: -filename
Stsadm –o restore –url http://vanillargk:6666 –filename "e:\backup5555.bak"
Restored site should be up and running.
If it is not (and you are receiving weird errors in your browser), keep reading:
Now it could be the case that you have customized your site. So, we must deploy those customizations properly for the site to work as expected. This is typically a scenario while moving your site from Testing to Production environment. First you have to add the solutions (if any created) to the farm.
Add a Solution to the SharePoint Farm:
Add the solution package to the farm by running the following commands. Make sure full path of WSP file is supplied.
stsadm –o addsolution –filename
Deploy the Solution to the restored site:
stsadm -o deploysolution -name mysolution.internet.test.wsp -url -immediate -allowgacdeployment –allowcaspolicies
Make sure all your assemblies (DLLs) are available in Global Assembly Cache (GAC) usually placed at c:\windows\assembly.
Activate features installed by mysolution.internet.test.wsp solution package:


Backup and restore will not work for sub sites.
Import and export will not work for workflows. It will work for sub sites and site collection also.