When a Configuration Manager (formerly SCCM, also called ConfigMgr or MECM) site server or its database is lost, recovery is a setup operation with a handful of decisions that are hard to undo. In this post I'll walk through choosing the recovery options, running setup from CD.Latest, what changes in a hierarchy, the unattended alternative, and the post-recovery tasks that most runbooks forget. If you haven't prepared yet, start with backup and recovery readiness.
Errors this guide fixes
Failed to decrypt cert PFX datadistmgr.log
Prerequisites#
- Active Directory and DNS are healthy. In a forest-wide outage, Configuration Manager comes after the domain controllers. Follow the AD forest recovery guide first, then bring back PKI and SQL Server, then the CAS, then primary sites. Messaging, such as the Exchange Server recovery, can run in parallel once AD is back.
- A server with the same hostname and FQDN as the failed site server, domain-joined, meeting the site prerequisites. A newer Windows Server version is fine. Use a clean build; leftover
HKLM\SOFTWARE\Microsoft\SMSkeys orSMS_*services cause conflicts. - The same SQL Server and instance, the same site database name and the same SQL Server Service Broker port. A newer SQL Server version is supported; a different edition isn't.
- The backup set and a
CD.Latestcopy that matches the site's version, placed outside the Configuration Manager installation folder. - Your site documentation: site code, install path, account passwords, certificates and hotfix list.
How it works#
Setup treats the site server and the site database as two separate decisions.
| Setup option | When to use it |
|---|---|
| Recover the site server using an existing backup | You have a snapshot from the Backup Site Server task. Site settings come back from the backup. |
| Reinstall the site server | No site server backup. You re-enter the settings as for a new install, with the same site code and database name. |
| Recover the site database using a backup set | You have the database from the backup task. Recovery fails if a database with that name already exists. |
| Create a new database for this site | No database backup, and the site is in a hierarchy. Data replicates from the CAS (or from a reference primary site when recovering the CAS). Not available for a standalone primary. |
| Use a site database that has been manually recovered | You already restored the database with SQL Server or Data Protection Manager. |
| Skip database recovery | The database is intact, for example on a surviving availability group node. Only valid when SQL Server is on a different computer from the site server. |
In a hierarchy, data loss is limited. A recovered primary site gets global data changes made since the backup from the CAS, and the CAS reinitializes the primary's site data from the recovered site. A recovered CAS pulls changes from its primary sites, or reinitializes global data from a reference site you choose when the backup is older than the five-day change tracking retention period. A standalone primary site simply loses everything changed after the backup; clients resend most of their data over time.
Step-by-step#
1. Restore the files you need#
Copy the backup snapshot and its CD.Latest folder to the new server, for example E:\Restore. If you use a SQL Server or DPM backup, restore the site database on the original instance now. For an availability group, restore on a standalone instance first and move it back afterwards.
2. Run setup from the CD.Latest copy#
Start E:\Restore\CD.Latest\SMSSETUP\BIN\X64\setup.exe as administrator. Don't use the original media or the installation folder: once a site has taken in-console updates, setup from those locations can't recover it. On Getting Started, select Recover a site, then:
- Choose the site server option and point it at the backup set.
- Choose the database option from the table above.
- Confirm the SQL Server name, instance and database name. Keep the Service Broker port that setup detects; changing it breaks database replication after recovery.
- When recovering a CAS with an old or missing database backup, pick a reference primary site.
- Confirm the installation path. Setup lets you choose a new one, but reusing the original keeps your documentation and scripts valid.
- Point setup to the
Redistfolder inCD.Latest, or let it download current prerequisites.
Follow progress in C:\ConfigMgrSetup.log at the root of the system drive; it records setup and recovery activity. Prerequisite results land in ConfigMgrPrereq.log.
3. Or run an unattended recovery#
For a scripted runbook, build an INI answer file and run setup.exe /script E:\Restore\Recover-PS1.ini from an elevated prompt. There are no defaults, so every required key must be present. This example recovers a standalone primary site server and database from the backup task:
[Identification]
Action=RecoverPrimarySite
CDLatest=1
[RecoveryOptions]
ServerRecoveryOptions=1
DatabaseRecoveryOptions=10
SiteServerBackupLocation=E:\Restore\PS1Backup
BackupLocation=E:\Restore\PS1Backup
[Options]
ProductID=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
SiteCode=PS1
SMSInstallDir=D:\Program Files\Microsoft Configuration Manager
SDKServer=cm01.contoso.com
PrerequisiteComp=1
PrerequisitePath=E:\Restore\CD.Latest\Redist
AdminConsole=1
JoinCEIP=0
[SQLConfigOptions]
SQLServerName=cmsql01.contoso.com
DatabaseName=CM_PS1
SQLSSBPort=4022
[CloudConnectorOptions]
CloudConnector=0Key values: ServerRecoveryOptions is 1 (site server and SQL Server), 2 (site server only) or 4 (SQL Server only). DatabaseRecoveryOptions is 10 (restore from backup), 20 (manually recovered), 40 (create new database) or 80 (skip). Use Action=RecoverCCAR for a CAS, add ReferenceSite when you create a new database, and add CCARSiteServer in a [HierarchyExpansionOption] section for a child primary site. Match CloudConnector to how the site was configured before the failure.
Post-recovery tasks#
The setup Finished page lists the accounts to fix and the hotfixes to reinstall, and saves the same list to C:\ConfigMgrPostRecoveryActions.html. Work through it:
- Re-enter account passwords: Administration › Security › Accounts, open each listed account, Set the password, then Verify and Test connection.
- PXE and task sequence passwords: re-enter the PXE password on each PXE-enabled distribution point, and passwords in task sequence steps such as Apply Network Settings, Join Domain or Workgroup, Run Command Line and Run PowerShell Script.
- Sideloading keys: re-enter them. The Activations used count resets to 0, so adjust your tracking.
- Hotfixes: reinstall any out-of-band hotfixes from the list.
- Certificates: rebind the IIS web server certificate on HTTPS roles. If
distmgr.logshowsFailed to decrypt cert PFX data, regenerate or reimport the distribution point certificate withSet-CMDistributionPoint. In non-PKI environments, recreate bootable and prestaged media. Restore any SQL Server encryption certificate used for BitLocker management recovery data. - Cloud services: if
cloudmgr.logreports an index error, renew the secret key for each Azure tenant connection. After a CAS recovery, recreate external notification subscriptions. - Content: restore the content library and package sources to their original paths, or import a prestaged content file or run Update Content per package.
- Reporting and software updates: restore custom reports from the report server backup, and confirm the software update point syncs (
wsyncmgr.log,WCM.log); the WSUS sync troubleshooting guide helps if it doesn't.
Verify#
ConfigMgrSetup.logends without errors and the console connects to the site.- Monitoring › System Status › Site Status and Component Status are green, with no new install errors in
sitecomp.log. - Monitoring › Database Replication shows every link as active;
rcmctrl.logrecords the replication activity. After a CAS recovery, if hardware inventory or status messages from child sites don't replicate, reenable theConfigMgrDRSSiteQueueon the CAS database:
IF EXISTS (SELECT * FROM sys.service_queues
WHERE name = 'ConfigMgrDRSSiteQueue' AND is_receive_enabled = 0)
ALTER QUEUE [dbo].[ConfigMgrDRSSiteQueue] WITH STATUS = ON- Monitoring › Distribution Status › Content Status shows content as successful; use Validate on distribution points that report problems (see the content distribution guide).
- A test client receives policy, a test deployment installs, and reports run from the reporting services point.
Tips and gotchas#
- Running setup on a server that still hosts the site disables the site server recovery option; start from a clean server.
- On a child primary, don't uninstall the site to "clean" the server. The CAS loses contact with it and the recovery fails.
- If at least one availability group node survives, choose Skip database recovery.
- Secondary sites have no backup: use Recover Secondary Site in Administration › Site Configuration › Sites, with the same FQDN, installation path and SQL Server instance.
- Database replicas for management points need their publications and subscriptions recreated after a database restore.

