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.
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-DhcpServerto a share or another disk from a scheduled task. - To migrate or restore cleanly, use
Export-DhcpServer/Import-DhcpServerorBackup-DhcpServer/Restore-DhcpServerrather 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
# As administrator: full backup to another locationBackup-DhcpServer -Path 'D:\Backups\dhcp'
# Restore (the DHCP service must restart)Restore-DhcpServer -Path 'D:\Backups\dhcp'
# Export configuration and leases for a migrationExport-DhcpServer -File 'D:\Backups\dhcp-export.xml' -Leases
# Configured interval and backup pathGet-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters' | Select-Object BackupInterval, BackupDatabasePath