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):

Add-DhcpServerSecurityGroup

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  192.168.10.35

-IncludeManagementTools

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 Migrate from Windows to Linux Mint

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...
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 ...
Data Deduplication on Windows Server 2016 First time data deduplication was introduced in Windows Server 2012. In the Windows Server 2016 represented the 3-rd version of deduplication componen...
Configure Access Based Enumeration on Windows Serv... By default, when user open some shared network folder, SMB displays full list of files and folders on it (of course only if user have permission to ac...