Restore a Configuration Database

Scenario/Problem: You want to restore a configuration database from a backup.

Solution: Use the Restore-SPFarm cmdlet with the Directory parameter and ConfigurationOnly switch parameter.

The Restore-SPFarm cmdlet enables you to restore a configuration database based on the backup files in the directory specified. Use the -ConfigurationOnly switch parameter to restore only the configuration database, as shown in Listing 7.12.

Listing 7.12. Sample Script for Restoring a Configuration Database

Restore-SPFarm -Directory F:\Backups -ConfigurationOnly-RestoreMethod Overwrite

The RestoreMethod parameter can be New or Overwrite. Using New creates a new location for the backup to be restored. Overwrite will restore ...

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.