In this tutorial, you will learn how to backup and restore Windows DHCP server using the DHCP console and PowerShell.
Have you ever experienced a DHCP server crash or failure? All is calm until devices start rebooting.
Users will complain that they can’t access email, the internet stops working and their apps no longer work. That’s because the DHCP server is down and they are not getting connected to the network.
It’s really easy to spin up a new DHCP server but do you remember all the scopes you need to re-create? What about those reservations, did you memorize all those MAC addresses?
Let’s check out how to backup your DHCP server for a fast recovery.
DHCP Database Auto Backup Every 60 minutes
By default, Windows will backup the DHCP configuration every 60 minutes at this location %SystemRoot%System32\DHCP\backup.
Important Tip: Although Windows automatically backs up the DHCP configuration it will do you no good if the server crashes and you are unable to access the file system. It is recommended to either change the location to a network share or use backup software to backup the folder. You could also schedule a task to copy the backup folder to another location.
If you don’t like video tutorials or want more details, then continue reading the instructions below.
Manual DHCP Backup Using DHCP Console
In this example, I’ll be backing up the DHCP configuration on server DHCP1. Later in this tutorial, I’ll be restoring this backup to server DHCP2.
Step 1: Create a Backup Folder
I’ve created a folder on the server desktop called DHCPBackup
Step 2: Open the DHCP Administration Console
The DHCP console is located in start -> Windows Administrative Tools -> DHCP
Step 3: Right Click the Server and Select Backup
Select the folder that was created in step 1. In my case, this was the DHCPBackup folder on the desktop. Then click OK
Unfortunately, there is no confirmation that the backup was completed.
You can go open the folder and verify data was backed up.
I can see that files were written to the folder, looks like the backup was completed successfully.
That is it for manually backing up the DHCP server. Now, let’s move on to the restore process.
Restore DHCP Server Using DHCP Console
Important Tip: You must copy the backup folder from the steps above to %SystemRoot%System32\DHCP\backup or you will get the following error saying the database was not restored correctly.
Step 1: Log into the server you want to restore the DHCP backup to
I’m logging into my 2nd DHCP server with the hostname of DHCP2.
Step 2: Copy the backup to the correct location
Now I will copy the DHCPBackup folder to %SystemRoot%System32\DHCP\backup
Step 3: Open The DHCP Console and Select Restore
On the DHCP Console, right click the server and select Restore
Now select the DHCPBackup folder
You will get a message that says the service must be stopped and restarted.
You can go browse the scopes to verify everything restored correctly.
I have a small lab but I can see the two scopes, leases, and reservations all restored.
Backup DHCP Server Using PowerShell
In this example, I’ll be logged in locally to the server.
Use the following command to backup the DHCP configuration using PowerShell.
Backup-DhcpServer -path c:\DHCPBackup
If you want to backup the DHCP server from a remote computer use this command
Backup-DhcpServer -ComputerName "dhcp1" -Path "C:\DHCPBackup"
Restore DHCP Server Using PowerShell
Step 1: Copy the backup folder to the correct path
Remember the backup has to be copied to “C:Window\ssystem32\dhcp\backup” or you will get permission errors.
Step 2: Run the following command
PS C:> Restore-DhcpServer -ComputerName "dhcp2" -Path "C:Windows\system32\dhcp\backup"
I hoped this article helped you learn how to backup and restore Windows DHCP servers. Let me know what you think by leaving a comment or questions below.