Backup and Restore SharePoint 2010 Site Collection using SharePoint 2010 Management Shell

In SharePoint 2010 we can backup and restore site collection using powershell instead of using stsadm.exe utility as previous version of SharePoint. To execute backup (for example, to backup http://portal.mysiteweb.co.id site collection) and restore it please do the following steps.

  1. On Start menu, click All Programs
  2. Click Microsoft SharePoint 2010 Products
  3. Click SharePoint 2010 Management Shell
  4. At Windows PowerShell command prompt type the following command
    Backup-SPSite –Identity http://portal.mysiteweb.co.id –Path D:\backup\homepage-2011-09-14.bak

To restore it to site collection, do the following steps.

  1. On Start menu, click All Programs
  2. Click Microsoft SharePoint 2010 Products
  3. Click SharePoint 2010 Management Shell
  4. At Windows PowerShell command prompt type the following command
    Restore-SPSite –Identity http://portal.mysiteweb.co.id –Path D:\backup\homepage-2011-09-14.bak -Force

This way can be used to publish site collection from dev/test environment to production. By using this way, all ID of SharePoint objects will be retained.