Migrating Windows DHCP to a new Server

Hayes JupeIT Director
CERTIFIED EXPERT
Microsoft infrastructure nerd with 20+ years experience. Australian based, but works worldwide.
Published:
Provides a step by of how to migrate Windows-based DHCP to a new server
Background
Migrating DHCP from one windows server to another is not a difficult process, but it is one that potentially needs to performed once every few years - and has some key points that can make your life easier.

Target audience
This article is aimed at admins that want to migrate a single DHCP server. Often DHCP is co-located on Domain Controllers - and as part of a DC upgrade process - DHCP must be migrated. This article is not for admins running DHCP failover clusters or any other more advanced scenarios. If you are running that type of setup, you know what you are doing and don't need this article.

Concepts
IP Swap - Where you swap the IP addresses of an "old" and "new" server, the new server "takes over" the IP address of the old server. This is commonly done where it makes life easier if the new server has the same IP address - such as DNS.

IP Helper - and configuration entry on a layer 3 device (such as router or routing switch) which points a specific network segment to a DHCP server.

DHCP Migration
  1. Logon to your source DHCP server.
  2. Clean up the existing DHCP server and scopes. Over time, things tend to drift and it is likely you will have old, un-used scopes, DHCP reservations that no longer exist etc. Remove these now so you are not bringing across extra rubbish that you don't need.
  3. Open an administrator level command prompt :
    1. Netsh - this will put the command window in "netsh" context.
    2. netsh> dhcp server \\<DHCP Server Name>
    3. netsh dhcp server> export C:\DHCPExport -all
  4. Logon to the destination DHCP server.
  5. Copy the DHCPExport file you created in step 3.3 to the local server.
    1. Open an administrator level command prompt
    2. Netsh - this will put the command window in "netsh" context
    3. netsh> dhcp server \\<DHCP Server Name>
    4. netsh dhcp server> import C:\DHCPExport -all
  6. Open the DHCP administrator administrative tool.
  7. Go to the "IP v4" leaf object, right click, properties.
  8. Advanced tab, set "conflict detection attempts" to 2 
    1. Setting this will enable you to migrate scopes from the old server to the new server without having to worry about the current leases.
  9. Deactivate the scopes or stop the DHCP service until you are ready to migrate.
  10. When you are ready to migrate :
    1. If you are migrating to a completely new DHCP server that will permanently be on a different IP address :
      1. Stop and disable the DHCP server service on the old server.
      2. Start/enable the DHCP service on your new server.
      3. Update any IP helpers on your layer 3 devices that may be required.
    2. If you are performing an "IP Swap" - so the DHCP server will be on the same IP as it was originally :
      1. Stop and disable the DHCP server service on the old server.
      2. Perform the IP Swap.
      3. Start/enable the DHCP service on your new server.

References
https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/netsh-utility-export-import-dhcp-scopes


0
2,832 Views
Hayes JupeIT Director
CERTIFIED EXPERT
Microsoft infrastructure nerd with 20+ years experience. Australian based, but works worldwide.

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.