Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Migrating an existing DHCP failover deployment to a newer version of Windows Server ensures your network infrastructure remains up-to-date, secure, and efficient. This comprehensive guide walks you through the entire migration process, starting with breaking the failover relationship on your current servers, exporting and importing DHCP settings, and configuring failover on the new servers. By following this guide, IT administrators can transition their DHCP failover setup to the latest Windows Server environment, ensuring minimal downtime, and uninterrupted network services.
Prerequisites
At least Windows Server 2012 installed.
The DHCP server role is installed.
An existing failover relationship exists.
Membership in the Administrators group, or equivalent, is the minimum required to complete these procedures.
Server details
The steps in this guide are valid for Windows Server versions starting from Windows Server 2012.
For this guide, consider the scenario where the DHCP failover deployment is migrated from Windows Server 2022 to Windows Server 2025. The following servers are used in this migration scenario:
- DHCP-2022-1: The initial DHCP server that's online with active scopes.
- DHCP-2022-2: The initial DHCP failover partner server for DHCP-2022-1.
- DHCP-2025-1: The DHCP server on Windows Server 2025 that replaces DHCP-2022-1.
- DHCP-2025-2: The DHCP server on Windows Server 2025 that replaces DHCP-2022-2.
Delete the failover relationship between DHCP-2022-1 and DHCP-2022-2
You can delete the failover relationship using PowerShell, or the DHCP console. Deleting a failover relationship removes all scopes that are members of the failover relationship from the partner DHCP server.
At an elevated Windows PowerShell prompt on DHCP-2022-1, use the cmdlet Remove-DhcpServerv4Failover to delete a failover relationship with the name DHCP-2022-1-DHCP-2022-2. Type the following command and then press ENTER:
Remove-DhcpServerv4Failover –Name DHCP-2022-1-DHCP-2022-2
Replace DHCP-2022-1-DHCP-2022-2 with the name of the DHCP failover relationship you wish to delete.
Use the cmdlet Get-DhcpServerv4Failover to get the failover relationships configured on the current DHCP server. Type the following command and then press ENTER:
Get-DhcpServerv4Failover
Verify that the DHCP failover relationship name isn't displayed in the command output, indicating that it's successfully deleted.
Note
DHCP scopes from the failover relationship are removed from the partner DHCP server. Scopes remain on the server where you entered the Remove-DhcpServerv4Failover command (DHCP-2022-1 in this example).
Export DHCP settings to new server
Use the following procedure to export server level settings from the DHCP server that has scopes you wish to enable for DHCP failover, in preparation for import to your new DHCP servers on Windows Server 2025. Only the DHCP server level configuration is exported and imported because the lease database is replicated from DHCP-2022-1 to DHCP-2025-2 when the failover relationship is established.
Note
If you're using clustered DHCP, you only need to export DHCP settings from the active node.
Export DHCP settings
Follow the steps to export DHCP settings from DHCP-2022-1.
On DHCP-2025-1, open an elevated Windows PowerShell prompt, enter the following commands:
mkdir C:\export mkdir C:\backup Export-DhcpServer –ComputerName DHCP-2022-1 –File C:\export\DHCP-2022-1exp.xml -Verbose
Connect to DHCP-2025-2, and in an elevated Windows PowerShell prompt, run the following:
mkdir C:\export mkdir C:\backup Export-DhcpServer –ComputerName DHCP-2022-1 –File C:\export\DHCP-2022-1exp.xml -Verbose
DHCP configuration settings are exported from a remote DHCP server, DHCP-2022-1, to a file on the local server, DHCP-2025-1 and DHCP-2025-2.
Alternatively, you can export to a file on DHCP-2022-1, and then copy the settings file over the network to DHCP-2025-2 and DHCP-2025-1.
Import DHCP settings
The following procedure assumes DHCP settings are saved in the C:\export\DHCP-2022-1exp.xml file on a DHCP server with a host name of DHCP-2025-1. Replace the file and host names with names used in your environment. Don't repeat this procedure on DHCP-2025-2.
Import DHCP settings and leases to new server
Follow the steps to import DHCP settings and leases to DHCP-2025-1.
At an elevated Windows PowerShell prompt, enter the following commands:
Import-DhcpServer –ComputerName DHCP-2025-1 –File C:\export\DHCP-2022-1exp.xml -BackupPath C:\backup\ -ServerConfigOnly -Verbose -Force
This command imports only the server-level configuration of DHCP-2022-1 to DHCP-2025-1. Server-level settings include:
Custom vendor classes and user classes
Custom option definitions
Server-level option values
Server-level policies
MAC address filters
Custom conflict detection settings
These server-level settings must also be imported to the new DHCP failover partner server (DHCP-2025-2) with the same procedure.
Note
The –BackupPath parameter is used to specify a path where the current DHCP server’s database is backed up prior to making any configuration changes as part of the import operation. To roll back the import operation, use the Restore-DhcpServer cmdlet, and specify C:\backup for the value of the -Path parameter.
Important
Verify that options and settings on DHCP-2025-1 are correct before proceeding.
Import DHCP settings to new failover partner server
Follow the steps to import DHCP settings to DHCP-2025-2.
At an elevated Windows PowerShell prompt, enter the following commands:
Import-DhcpServer –ComputerName DHCP-2025-2 –File C:\export\DHCP-2022-1exp.xml -BackupPath C:\backup\ -ServerConfigOnly -Verbose -Force
Configure DHCP failover between DHCP-2022-1 and DHCP-2025-1
Next, configure DHCP failover for all desired scopes on DHCP-2022-1, specifying DHCP-2025-1 as the failover partner server. For procedures to configure DHCP failover using PowerShell or the DHCP console, see Configure DHCP Failover.
This step replicates scopes and leases to DHCP-2025-1 in preparation for taking DHCP-2022-1 offline.
Delete the DHCP failover relationship on DHCP-2025-1
Delete the DHCP failover relationship on DHCP-2025-1.
At an elevated Windows PowerShell prompt on DHCP-2025-1, enter the following command:
Remove-DhcpServerv4Failover –Name DHCP-2022-1-DHCP-2025-1
In the previous procedure, replace DHCP-2022-1-DHCP-2025-1 with the name of the DHCP failover relationship you created in the previous procedure.
Type the following command and then press ENTER:
Get-DhcpServerv4Failover
Verify that the DHCP failover relationship name isn't displayed in the command output, indicating that it's successfully deleted.
Note
DHCP scopes added to the failover relationship ARE removed from the partner DHCP server. Scopes remain on the server where you entered the Remove-DhcpServerv4Failover command (DHCP-2025-1 in this procedure).
Configure DHCP failover between DHCP-2025-1 and DHCP-2025-2
Next, configure DHCP failover for all desired scopes on DHCP-2025-1, specifying DHCP-2025-2 as the failover partner server. For procedures to configure DHCP failover using PowerShell or the DHCP console, see Configure DHCP Failover.
Update DHCP relay agents and complete migration
Finally, update DHCP relay agents to use the new DHCP servers and complete DHCP migration.
After leases and settings are replicated to DHCP-2025-1 and DHCP-2025-2, settings are verified, and DHCP relays are updated, you can stop the DHCP Server service on DHCP-2022-1 and DHCP-2022-2 so that new DHCP leases are only issued from DHCP-2025-1 or DHCP-2025-2.