Thursday 28 February 2013

Taking Backup and restore sharepoint in command line

Taking site backup and restoring using STSADM is probably the easiest and fastest one.
Backup the site using the following STSADM Command:

stsadm -o backup -url http://mysite/ -filename backup-filename.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://myothersite/ -filename backup-filename.bak

For some reason we needed to create an empty web application and a site collection first, and restore on top of that using the -overwrite option of stsadm.exe,

This backup/restore command can only used for site collection back up/restore.
If it is a single site, export/import command is using instead of backup/restore

1 comment: