Since 2016 · 50,000+ customers · ★ 5.0 on Google Live chatWhatsAppTelegramOpen a ticket
Get started
Windows Server

How to Back Up and Restore a DHCP Server (Windows Server 2016–2025)

Back up a DHCP server with PowerShell on Windows Server

If a DHCP server's database is lost, clients stop getting IP addresses as their leases expire, so a working backup is essential. Windows Server already backs up the DHCP database automatically every hour, but that copy sits on the same server. This guide shows how to make your own backups with PowerShell or the DHCP console, how to restore them, and how to export DHCP settings to move them to a new server.

Quick answer(PowerShell as Administrator):

Backup-DhcpServer -ComputerName "DHCP01" -Path "D:\DHCPBackup"
# restore later:
Restore-DhcpServer -ComputerName "DHCP01" -Path "D:\DHCPBackup"
Restart-Service DHCPServer

How Windows backs up DHCP automatically

The DHCP Server service copies its database to %SystemRoot%\System32\dhcp\backup every 60 minutes. That protects against database corruption, but not against losing the server. Copy your backups somewhere else, such as another server, a NAS or cloud storage.

Comparison of DHCP automatic backups and manual backups with Backup-DhcpServer
Automatic vs manual backup

Back up DHCP with PowerShell

New-Item -ItemType Directory -Path D:\DHCPBackup -Force
Backup-DhcpServer -ComputerName "DHCP01" -Path "D:\DHCPBackup"

The backup includes scopes, reservations, options, leases and server settings. Schedule it with Task Scheduler and copy the folder off the server, for example:

$stamp = Get-Date -Format yyyyMMdd-HHmm
Backup-DhcpServer -Path "D:\DHCPBackup\$stamp"
robocopy "D:\DHCPBackup\$stamp" "\\backup01\dhcp\$stamp" /E
Steps to back up and restore a DHCP server: back up, copy off the server, restore on the new server, restart the service
Back up and restore DHCP

Back up DHCP with the DHCP console

  1. Open DHCP (dhcpmgmt.msc).
  2. Right-click the server name and choose Backup…
  3. Choose a folder (by default C:\Windows\System32\dhcp\backup) and click OK.

Restore a DHCP backup

PowerShell

Restore-DhcpServer -ComputerName "DHCP01" -Path "D:\DHCPBackup"
Restart-Service DHCPServer

DHCP console

Right-click the server → Restore…, select the backup folder, and confirm that the service will be stopped and restarted.

After restoring, check that scopes are active and leases look right. Leases handed out after the backup was taken aren't in it; clients simply renew them, and conflict detection (Set-DhcpServerSetting -ConflictDetectionAttempts 2) helps avoid duplicate addresses in the meantime.

Checklist for moving a DHCP server: authorise the new server, check scopes and leases, then stop the old one
Moving DHCP safely

Move DHCP to a new server (export and import)

For migrations, export the configuration to a file instead of using a database backup:

# on the old server
Export-DhcpServer -ComputerName "OLD-DHCP" -File "C:\dhcpexport.xml" -Leases
# on the new server (DHCP role installed and authorized)
Import-DhcpServer -ComputerName "NEW-DHCP" -File "C:\dhcpexport.xml" -BackupPath "C:\dhcpbackup" -Leases
Add-DhcpServerInDC -DnsName "NEW-DHCP.contoso.local"

Then stop and deauthorize the old server so two servers don't hand out the same addresses: Remove-DhcpServerInDC -DnsName OLD-DHCP.contoso.local.

Best practices

  • Back up after every significant change (new scopes, reservations, options).
  • Keep at least one copy off the DHCP server.
  • Test a restore on a lab VM occasionally.
  • For high availability, set up DHCP failover between two servers so one keeps working if the other fails.

Frequently asked questions

How do I back up a DHCP server with PowerShell?

Run Backup-DhcpServer -Path D:\DHCPBackup as Administrator, then copy the folder off the server.

Where is the DHCP backup stored by default?

In %SystemRoot%\System32\dhcp\backup, updated automatically every 60 minutes.

What's the difference between Backup-DhcpServer and Export-DhcpServer?

Backup-DhcpServer copies the DHCP database for restoring the same server. Export-DhcpServer writes the configuration (and optionally leases) to an XML file, ideal for moving DHCP to another server.

Does restoring DHCP bring back current leases?

It restores the leases that existed when the backup was taken. Newer leases are renewed by clients.

Minakshi, Server Administrator L1 at 99RDP
Written byMinakshiServer Administrator L1, 99RDP. Part of the team that runs our servers and answers support.
Keep reading

More Windows Server guides

All Windows Server guides

Need a server for this?

✓ Setup in minutes✓ Full admin access✓ 7-day refund on new services