Skip to contentGo to the directory tree
FolderRisk: Caution
  • Windows Server

backup C:\Windows\System32\dhcp\backup

backup: the DHCP server's automatic local backup of its lease database (dhcp.mdb) and configuration, refreshed every 60 minutes by default.

Updated on By AltF4 Formation

What it’s for

The DHCP Server service copies its lease database and configuration into this folder on its own, every 60 minutes by default (the BackupInterval value, in minutes, under HKLM\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters). The folder is set by BackupDatabasePath in the same key. If the dhcp.mdb database is corrupted, this copy is what you restore from.

What it contains

A copy of the database (dhcp.mdb, in a new subfolder) and an export of the configuration (DhcpCfg). There is only one generation: each cycle replaces the previous one.

Risks and best practices

  • This backup sits on the same disk as the database, so it protects against neither a volume failure nor a server loss. Also run Backup-DhcpServer to a share or another disk from a scheduled task.
  • To migrate or restore cleanly, use Export-DhcpServer / Import-DhcpServer or Backup-DhcpServer / Restore-DhcpServer rather than copying files by hand.
  • If the server is part of a DHCP failover relationship, the configuration is replicated to the partner; the local backup remains useful for restoring state.

Useful commands

Fenêtre de terminal
# As administrator: full backup to another location
Backup-DhcpServer -Path 'D:\Backups\dhcp'
# Restore (the DHCP service must restart)
Restore-DhcpServer -Path 'D:\Backups\dhcp'
# Export configuration and leases for a migration
Export-DhcpServer -File 'D:\Backups\dhcp-export.xml' -Leases
# Configured interval and backup path
Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters' | Select-Object BackupInterval, BackupDatabasePath

Report a mistake