Netflex Blog

Migrate DHCP from Windows Server 2008 R2 to Windows Server 2012 R2

windowsserver

This blog provides information on how to migrate your Windows Server 2008 or Windows Server 2008 R2 DHCP server to Windows Server 2012 R2.

First, to be on the save side, create a backup of the Windows Server 2008 (R2) DHCP configuration and save it to disk. Now the backup is in place inventory your DHCP relay configuration, you will need this information later.

Install a Windows Server 2012 R2 server (or two if you want things to be redundant) and install the DHCP role on it. Next start Powershell from the Windows Server 2012 R2 server to export the DHCP information from the Windows Server 2008 (R2) server. You can use the following cmdlet for this:

Export-DhcpServer –ComputerName 2008R2DHCPServer.domain.com -Leases -File C:ExportDhcp.xml –verbose

This will export all the DHCP scopes, server options, reservations and leases to the specified XML file. You could leave the –leases option if you don’t need it. The –verbose option will display detailed information on screen.

 

Next if you already authorized the new Windows Server 2012 R2 server remove the binding from the server. Otherwise there will be 2 DHCP server servicing the same scopes.

 

Now we are ready to import the DHCP setting we exported earlier.

Import-DhcpServer –ComputerName 2012R2DHCPServer.domain.com -Leases –File C:ExportDhcp.xml -BackupPath C:DhcpBackup –Verbose

This will import the entire XML file. If you want to import only specific scopes use the following command:

Import-DhcpServer –ComputerName 2012R2DHCPServer.domain.com -Leases –File C:ExportDhcp.xml -BackupPath C:DhcpBackup –Verbose –ScopeId 10.1.1.0, 10.1.2.0

When using 2 DHCP servers import all the settings to the DHCP server intended to be the primary server. Import only server specific information to the secondary DHCP server.

Import-DhcpServer –ComputerName 2012R2DHCPServer.domain.com –File C:ExportDhcp.xml –ServerConfigOnly –verbose –BackupPath C:DhcpBackup

Set “Conflict detection attempts” to 1 on the Windows Server 2012 R2 DHCP server to prevent the new DHCP server from issuing an already issued ip.

 

Now remove the binding from the Windows Server 2008 (R2) DHCP server and authorize your new DHCP server (or add the binding if it was already authorized). If everything is running smoothly unauthorise the Windows Server 200 (R2) DHCP server.

The last step is to configure your DHCP relay agents to point to the Windows Server 2012 R2 DHCP servers ip address (or the failover address if you intend to make it redundant). For more information about a high availability setup check the links below. I hope this blog helped you migrate DHCP, leave any questions in the comments.

 

Links:

Install DHCP role

DHCP High Availability

Scroll to Top