migrate dhcp

How to Migrate DHCP to Windows Server 2016

Migrating the DHCP service from the old server to the new Windows Server 2016 with saving of all the settings of the old server is quite easy. If the old DHCP server is running Windows Server 2008/R2 or Windows Server 2012/R2, you can directly transfer DHCP settings, zones and reservations.

First of all, you need to install the DHCP Server role on a new server which is running Windows Server 2016. You can install the DHCP Server role using the Server Manager console, where you need to run the Add Roles Wizard in the Manage -> Add Roles and Features menu and select the DHCP Server.

But it’s much easier to install the role and role management tools from RSAT (DHCP console and PowerShell module for working with DHCP) using PoSh.

Start the PowerShell console as Administrator and run the following command:

Add-WindowsFeature -IncludeManagementTools DHCP

The -IncludeManagementTools parameter must be specified to install the DHCP server management console. By default, Add-WindowsFeature installs the DHCP server role without the appropriate console.

Next you need to create local DHCP security groups (DHCP Administrators and DHCP Users):


To enable DHCP security settings associated with the local security groups created, restart the DHCP Server service:

Restart-Service DHCPServer

Authorize the new DHCP server in the Active Directory domain:

Add-DhcpServerInDC  host1.contoso.com


However, after the DHCP role is installed and the post-installation settings with PowerShell are performed, a connection to this server in the Server Manager console will result in a warning that a post-installation setup is required, even though it has actually already been executed. In this case, even the restart of the server will not help to make this warning disappear.

READ ALSO  How to Setup FTP Server in Windows 10

dhcp configuration

To remove this status, let’s modify the registry key to a value indicating that the actual DHCP Server role has already been configured using PowerShell:

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

In Windows Server 2012 a special PowerShell cmdlets have been added, allowing you to import/export any DHCP server settings. Note that Microsoft simplified the procedure as much as possible, and we will need to execute only two PowerShell commands: Export-DhcpServer and Import-Dhcpserver, which can work remotely. All commands can be executed on one machine (the one to which the server migrates).

Create the folder c:\dhcp (new-item c:\dhcp -type directory) and run the command to export the configuration of the old DHCP server to the XML file named OldDHCPConf.xml.

Export-DhcpServer -ComputerName "oldDhcp.contoso.com" -Leases -File "C:\DHCP\OldDHCPConf.xml" –Verbose

import dhcp server

Now you can perform a full import of the DHCP configuration on the new server:

Import-DhcpServer -Leases –File "C:\DHCP\OldDHCPConf.xml" -BackupPath "C:\DHCP\Backup\" –Verbose

Everything is ready. Open the DHCP console and check that all the DHCP scopes, reservations and IP leases are in place.

migrate dhcp server

In the event that you created a failover DHCP configuration uses DHCP Failover, the second server only needs to import the DHCP server configuration:

Import-DhcpServer -Leases –File "C:\DHCP\OldDHCPConf.xml" -ServerConfigOnly  -BackupPath "C:\DHCP\Backup\" –Verbose

After the migration of the DHCP server completed, do not forget to reconfigure the DHCP Relay (IP Helper) agents on the routing network devices.

READ ALSO  How to Install and Configure vsFTPd on CentOS 7

You may also like:

Performing a System State Backup in Windows Server... Follow the instructions below to perform a system state backup in Windows Server 2003. We realize this is an old operating system, but there are a lot...
Active Directory Temporary Group Membership on Win... Often some access rights in Active Directory must be granted temporarily, for a certain period of time. In order to avoid the need to monitor the vali...
How to Migrate Print and Document Services from Wi... This time we will take a closer look on how to migrate print server with the Print and Document Services role installed from Windows Server 2012 R2 to...
How to Install and Configure IIS Web Server with P... This guide will show you how to deploy your own IIS Web server, and enable it to run PHP on Windows 8 / Windows Server 2012. Thereafter this platform ...
How to Install and Configure DNS Server on Windows... This article is a step by step tutorial on how to install and configure a DNS Server on Windows Server 2012. MS Windows Server 2012 is a great and ...