This article describes how to migrate a configured DHCP server from one Windows Server host to another, while retaining all DHCP scope settings. You can use this guide to migrate DHCP settings, zones, and DHCP reservations from an earlier version of Windows Server to a newer version (for example, from Windows Server 2012/R2 to Windows Server 2022), or to move a DHCP role to a new host in Active Directory domain.
Prepare New Windows Server Host for DHCP Role
Prepare a new host to which you are going to migrate the DHCP server. Install the version of Windows Server you need (2022, 2019, or 2016), set a unique host name and IP address, and join the computer to the Active Directory domain.
Install the DHCP Server host
Install the DHCP Server host on the new server using the Server Manager console (Manage > Add Roles and Features > DHCP Server) or via PowerShell:
Add-WindowsFeature -IncludeManagementTools DHCP
Create two local security groups
Then run the following command, which will create two local security groups that will be used to manage DHCP server:
Add-DhcpServerSecurityGroup
- DHCP Administrators — these are users with full permissions on the DHCP server (they can change any settings), but without local admin permissions on Windows Server;
- DHCP Users — users with the rights to view DHCP server settings and statistics (including the DHCP Leases info).
Restart the DHCP Server service:
Restart-Service DHCPServer
Authorize the new DHCP server
Then authorize the new DHCP server in the Active Directory domain. Run the following command as the domain admin account that is a member of the Enterprise Admins group.
To authorize the new DHCP server in the Active Directory domain:
Add-DhcpServerInDC -DnsName host1.contoso.com -IPAddress 192.168.10.35
Replace the DnsName and IPAddress values with your own.

Now check if the DHCP server has been successfully authorized in AD and make sure the new DHCP server appears in the list of authorized DHCP servers:
Get-DhcpServerInDC
DHCP server authorization without Enterprise Admin rights
You can start a DHCP server without authorization in AD if you don’t have Enterprise Admin rights. Create the following registry parameter:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters" -Name DisableRogueDetection -Value 1 -Force
To prevent the ‘Configuration required for DHCP server on host’ alert from being displayed in the Server Manager console, set the reg key to assume that the DHCP configuration is complete:
Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2
Note that you should use this workaround only in isolated lab/workgroup environments. In AD production environments, we recommend you authorizing DHCP servers in AD instead of disabling rogue detection.

Then restart the DHCP service:
Restart-Service -Name DHCPServer -Force

Transferring DHCP Server Role to Another Windows Server Host
Before exporting or importing DHCP settings, you should check if the DHCP PowerShell module is available on the server:
Get-Module DHCP -ListAvailable
You can also list the available DHCP cmdlets with the command:
Get-Command *DhcpServer*
In case these commands return no results, you need to ensure that the DHCP Server role/RSAT DHCP management tools are installed.
Temporarily change the Lease duration (DHCP scope option) on the source server to 2 hours. This will allow your client to obtain IP addresses from the new DHCP server more quickly.
The easiest way to transfer DHCP server settings to a new host in modern versions of Windows Server (2022/2019/2016/2012/R2) is to use the PowerShell cmdlets Export-DhcpServer and Import-DhcpServer.
These commands allow you to connect to a remote DHCP server over the network, export its settings and import them into a new server.
Create the C:\DHCP folder
Create the C:\DHCP folder on the new DHCP server machine. Open the PowerShell console under an account that is a member of the DHCP Administrators group and export the configuration of the old DHCP server to the XML file:
Export-DhcpServer -ComputerName "oldDhcp.contoso.com" -Leases -File "C:\DHCP\OldDHCPConf.xml" –Verbose
Note that the -Leases parameter is optional. If you only need scopes, reservations, and DHCP options, you can omit it.

Import resulting DHCP configuration
Then import the resulting DHCP configuration file into your new server:
Import-DhcpServer -Leases –File "C:\DHCP\OldDHCPConf.xml" -BackupPath "C:\DHCP\Backup" –Verbose
Note that you should run the Import-DhcpServer command on the destination DHCP server where the DHCP role is installed. In case the -ComputerName parameter is omitted, the config is imported into the local DHCP server.
Run the DHCP console and check that all the DHCP scopes, reservations, and IP leases are in place.
You can also verify the imported config with following PowerShell commands:
Get-DhcpServerv4Scope
Get-DhcpServerv4Reservation
The commands above allow you to confirm that DHCP scopes and reservations were imported successfully before performing GUI validation/client testing.

Once the DHCP server migration is complete, do not forget to reconfigure the DHCP Relay (IP Helper) agents on the routing network devices. Reconfigure them to point on the IP address of the new DHCP server.
Reboot several workstations to test and confirm that they are receiving DHCP leases from the new server (check the lease information for your DHCP scope).
How to Migrate the DHCP Role Using the Backup and Restore
In Windows Server 2016 and newer, you can migrate your DHCP server settings using the Backup and Restore options in the DHCP Management console GUI.
- Open dhcpmgmt.msc console;
- Right-click on the DHCP server and select Backup;

- Specify the directory to save the backup copy of the DHCP server settings.
You can use this backup copy to restore the DHCP server settings on the current or another Windows Server host. However, if you simply copy the DHCP backup files to a new server and try to restore the configuration using the Restore option in DHCP console, an error will occur when importing the DHCP database:
The database was not restored correctly. No changes were made. For more information, please see Event Viewer on the specified server.

To successfully migrate your DHCP server config to a new device, copy your DHCP backup to the %SystemRoot%\System32\DHCP\backup directory on a new machine. Then click the Restore option in the DHCP console and select to restore the configuration from this folder.

If everything was successful, the following message should appear:
The database was restored successfully.

Note that by default, Windows backs up the DHCP configuration and leases every 60 minutes to the %SystemRoot%\System32\DHCP\backup directory.
The backup directory is configured in the DHCP server settings.

You can list the current DHCP backup settings using the PowerShell command:
Get-DhcpServerDatabase
FileName : C:\Windows\system32\dhcp\dhcp.mdb
BackupPath : C:\Windows\system32\dhcp\backup
BackupInterval(m) : 60
CleanupInterval(m) : 60
LoggingEnabled : True
RestoreFromBackup : False

If your DHCP Windows Server host fails, you can manually copy the DHCP database files from the backup directory on the failed server’s disk and restore its configuration to the new server.
Migrate DHCP Server from Windows Server 2003
Note that Windows Server 2003 is no longer supported. This section is provided only for legacy migration cases.
If you are using a legacy DHCP server on Windows Server 2003/R2, you need to use a different migration method. This is because Windows Server 2003 does not support the PowerShell cmdlets for exporting DHCP settings that are available in newer versions of Windows Server.
To export the DHCP server configuration to a binary file on Windows Server 2003, use the following command:
netsh dhcp server export C:\ps\dhcp2003_config.dat all
You can import the DHCP configuration on a new host using the command:
netsh dhcp server import \\winsrv2003dhcp\c$\ps\dhcp2003_config.dat all
DHCP Server Post Migration Steps
Change the lease duration settings on the new server if you have previously changed them. The default lease duration for the DHCP scope on Windows Server is 8 days.
Now you need to disable the DHCP service on the old server:
Stop-Service DHCPserver Set-Service -Name DHCPServer -StartupType "Disabled"
And unauthorize the old DHCP server from Active Directory from the DHCP console (right-click on the DHCP server name > Unauthorize)

Or use the PowerShell command:
Remove-DhcpServerInDC -DnsName "oldDhcp.contoso.com” -IPAddress 192.168.10.36
After completing the migration, you need to check that only the new DHCP server remains authorized in AD:
Get-DhcpServerInDC
Now confirm that the old DHCP server is no longer listed.
You can also check that the new DHCP server is actively leasing addresses and monitor scope utilization with the command:
Get-DhcpServerv4ScopeStatistics
Review the lease and utilization statistics to confirm that clients are receiving addresses from the new DHCP server.
Then uninstall the DHCP Server Role:
Uninstall-windowsfeature dhcp -remove Uninstall-WindowsFeature RSAT-DHCP
And reboot the server:
Restart-Computer -Force
Keep in mind that in case your environment uses DHCP Failover, you need to remove/reconfigure the failover relationship before migrating scopes to a new server.
Can I migrate a DHCP server from Windows Server 2012/R2 to Windows Server 2022?
Yes. The Export-DhcpServer and Import-DhcpServer cmdlets support migration between supported Windows Server versions, including upgrades from Windows Server 2012/R2, 2016, 2019, and 2022.
Do I need to install the DHCP role before importing the configuration?
Yes. The destination server must have the DHCP Server role installed before running Import-DhcpServer. It is also recommended to create the DHCP security groups using Add-DhcpServerSecurityGroup.
Is DHCP server authorization in Active Directory required?
In production Active Directory environments, yes. The new DHCP server should be authorized using Add-DhcpServerInDC. Unauthorized DHCP servers will not lease addresses in a domain environment.
Can I migrate DHCP without Enterprise Admin permissions?
You can temporarily disable rogue detection and run DHCP without AD authorization in isolated lab or workgroup environments. This approach is not recommended for production Active Directory networks.
Does the migration include DHCP reservations and scope options?
Yes. DHCP scopes, reservations, exclusions, policies, and server/scope options are included in the exported configuration.
Are active DHCP leases migrated as well?
Only if you use the -Leases parameter during export and import. Without this parameter, only configuration data is transferred.

On the import I get this.
PS C:\dhcp> Import-DhcpServer -Leases -File “C:\DHCP\OldDHCPConf.xml” -BackupPath “C:\DHCP\Backup” -Verbose
Get-DhcpServerVersion : Failed to get version of the DHCP server DC3.
At line:1 char:1
+ Get-DhcpServerVersion 2> $null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (DC3:root/Microsoft/…cpServerVersion) [Get-DhcpServerVersion], CimExcept
ion
+ FullyQualifiedErrorId : WIN32 1753,Get-DhcpServerVersion
Hi,
Thank you for this tutorial. Very helpful.
I just noticed, that on one command you are missing to backslashes:
Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\…\Roles12 –Name ConfigurationState –Value 2
Between Microsoft and ServerManager
Between Roles and 12
Cheers Till
Fantastic article. Thanks SO much! You made my DHCP migration to a new domain controller stress-free.
I missed the comment from Till, but I just manually did the DHCP configuration from Server Manager instead when the Set-ItemProperty command failed for me.