Migrate DHCP Server to a new Windows Server

When you migrate a DHCP Server to another server, what you need to move is the database and server settings. These are the basic components of the DHCP Server.

Of course, depending on the needs and infrastructure of an enterprise, you may need to make even more changes such as setting up routers to use the new DHCP Server, etc. Obviously, this is something you need to include in your own your plan as I can not cover all these cases in an article.

For migrations from Windows 2008/2008 R2 and 2012/2012 R2 versions of Windows Server, you can use the Netsh command line tool. For Windows Server 2012/2012 R2 and 2016 versions, it is recommended to use PowerShell for migrating the DHCP Server.

Since it is an asynchronous way of migrating settings from one DHCP Server to another, that means there will be a downtime, at least small, until all the steps are completed.

A general practice followed in such cases is what I will describe immediately in the following scenario.

Suppose we have two DHCP Servers, DHCP01 and DHCP02. We will export the settings from DHCP01 and then import them to DHCP02.

DHCP01 should stop responding to client requests and take over DHCP02 entirely. We assume that the DHCP Server role is installed on both servers.

DHCP Server Migration, how it’s done

After connecting to the existing DHCP Server, DHCP01 in our example, open PowerShell, and export the settings.

Export-DhcpServer -ComputerName DHCP01 -File "C:\DHCP-Config.xml" -Force

Once completed, transfer the file that will be created to the new DHCP Server, DHCP02.

Next, you will need to stop sharing IP addresses from the existing server so that the newcomer will take over soon. This can be done in two basic ways, either to stop the DHCP Service or to unauthorize it. The choice is yours, as the case may be.

For example, you can stop the DHCP Service via PowerShell with the following command.

Stop-Service -Name DHCPServer
Set-Service -Name DHCPServer -StartupType "Disabled"

Or through the Services console. You should also set the Startup type to Disabled so that it does not automatically start for any reason.

Log in to the new DHCP Server and make sure the DHCP Server service is already running. With PowerShell, this is done in seconds.

Get-Service -Name DHCPServer

Next, import the settings you extracted from the “old” DHCP Server.

Import-DhcpServer -ComputerName DC02 -File "C:\DHCP-Config.xml -Force

Once completed, you can authorize the new DHCP Server so that it is now operational on your infrastructure.

At this point, you will need to check that all scopes, server options, etc. have been introduced, and that clients are normally receiving IP settings from the new DHCP Server.

When everything is working properly, reconnect to the old DHCP Server and remove the corresponding role to completely remove it from your infrastructure.

This is how a basic migration process of the DHCP Server is completed. I hope I helped.

About Dimitris Tonias 143 Articles
My name is Dimitris Tonias, IT Pro, G(r)eek, focused on Server, Virtualization, and Cloud technologies.

6 Comments on Migrate DHCP Server to a new Windows Server

  1. Hello,
    We have two dhcp servers.
    Both are Windows server 2016
    We want to merge all scopes to be on dhcp2 only.
    What process do you suggest?

  2. After moving everything to the new server no clients get the DHCP and when I turn on the old server all the clients start working. What am I missing?

  3. I get (in PS:administrator) ‘export’ is not recognized as the name of a cmdlet, function, script file or operable program…

Leave a Reply

Your email address will not be published.