Monday, January 28, 2013

TIP: Restore a Site Collection using PowerShell

Use this simple PowerShell script to backup a site collection:

Backup-SPSite -Identity YourSiteCollectionURL -Path YourBackupFilePath

And use this simple Powershell script to restore a site collection:

Restore-SPSite -Identity YourSiteCollectionURL - Path YourBackupFilePath

There are a number of additional parameters you can specify.  The one I use most commonly is the -Force option, which allows me to overwrite an existing site.

Notes
  • I use this script frequently to maintain a mirror for testing and development purposes.
References

No comments: