Saturday, June 9, 2012

How to restore content database using PowerShell in SharePoint 2010 ?



  1. Open SharePoint 2010 Management Shell.
  2. At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:

Restore-SPFarm -Directory <Backup folder name> -RestoreMethod Overwrite -Item <Content database name> [-BackupId <GUID>] [-Verbose]

3.      If you do not use the BackupId parameter, the most recent backup will be used. To view a list of the backups, including their Backup IDs, type the following command, and then press ENTER:

Get-SPBackupHistory -Directory <Backup folder>

No comments: