Tuesday, July 13, 2010

How to Backup and Restore SharePoint 2010 site collection

There are two options available (May be many) .

  • Using PowerShell
  • Using stsadm

In 2010 PowerShell is recommended. But in my case PowerShell commands not worked. I mean the midlets commands are missing in the pc. Therefore I used second option.

Option1

  • Backup
    • Go to the PowerShell (you should have execution permission and at least read permission to the SharePoint database)
      image 

    Apart from that you can provide many other parameters to the command.

    Backup-SPSite [-Identity] <SPSitePipeBind> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-NoSiteLock <SwitchParameter>] [-UseSqlSnapshot <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

    Refer

  • Restore
    • Go to the PowerShell and type following command. This command will create a site collection and restore the site. Other wise you can use force command to override the content  image

Option2

You can also use stsadm commands to backup and restore.

  • Backup
    • Open the command prompt
    • Goto C:\program files\common files\Microsoft shared\web server extensions\ 12 \ bin
    • Stsadm –o backup –url http://server/sites/name -filename C:\site.bak
  • Restore
    • Stsadm –o restore –url http://server/sites/name -filename C:\site.bak
    • You can use –override to replace the existing site.
Post a Comment