• Contact
  • Homelab
Dimitris Tonias
  • Management
  • Monitoring
  • Cloud
  • Virtualization
  • Networking
  • Productivity
No Result
View All Result
  • Management
  • Monitoring
  • Cloud
  • Virtualization
  • Networking
  • Productivity
No Result
View All Result
Dimitris Tonias
No Result
View All Result

Migrate DHCP Server to a new Windows Server

Dimitris Tonias by Dimitris Tonias
March 3, 2018 - Updated on April 21, 2024
in Management
Reading Time: 2 mins read
A A
10
Share on FacebookShare on Twitter

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

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

Stop-Service -Name DHCPServer

Set-Service -Name DHCPServer -StartupType "Disabled"

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

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

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.

Tags: DHCPDHCP ServerMigrationWindows Server 2016
ShareTweetPin
Previous Post

Import and Export DHCP Server 2016 settings

Next Post

Install .NET Framework 2.0, 3.0 and 3.5 on Windows 10

Related Posts

Approve updates in WSUS 2016
Management

Approve updates in WSUS 2016

Configure Group Policy to deploy updates using WSUS 2016
Management

Configure Group Policy to deploy updates using WSUS 2016

Configure computer groups in WSUS 2016
Management

Configure computer groups in WSUS 2016

The initial configuration of WSUS 2016
Management

The initial configuration of WSUS 2016

Install WSUS in Windows Server 2016
Management

Install WSUS in Windows Server 2016

Error opening Report Viewer on WSUS 2016
Management

Error opening Report Viewer on WSUS 2016

Comments 10

  1. Los says:
    6 years ago

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

    Reply
  2. Michael Christensen says:
    6 years ago

    What about the leases? can those be exported from 2012r2 and imported on a new 2012r2 DHCP server?

    Reply
  3. Jeff M says:
    5 years ago

    In reply to Michael Christensen:

    If you add the -leases command you can include the leases

    Reply
  4. Jeff Getts says:
    5 years ago

    Current Import-DhcpServer command makes -BackupPath a required parameter.

    Reply
  5. R says:
    4 years ago

    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?

    Reply
  6. David Carpi says:
    4 years ago

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

    Reply
  7. Sent to 'Don Hammer' says:
    3 years ago

    I completed the migration and everything looked fine on the new server. I authorized the new server and unauthorized and stopped dhcp services on the old. I connected a computer that was not running before the migration and it did not get a new lease. I moved back to the original server and the computer got an address. Is there a time period before the new dhcp server address is handed out? Is there a way to check this?

    Reply
  8. Matt says:
    3 years ago

    Update your info, doesn’t work

    Reply
    • Edwards says:
      3 years ago

      1. Build a New VM and Join to the domain
      2. From the Old DHCP server ” Check to ensure DHCP is working as it should” If all is OK move to the next step
      3. Old DHCP – Make a Note of the IP address details
      4. OLD DHCP – Create a folder called ” dhcpdata ”
      5. OLD DHCP – run cmd as administrator
      6. OLD DHCP – from cmd run ” netsh dhcp server export C:\dhcpdata\olddhcp.dat All ” This will backup all information in the OLD DHCP environment.
      7. Copy the “dhcpdata” folder and it contents to the NEW VM C:\ This is the server that will be using for the NEW DHCP server
      8. OLD DHCP – Unauthorize the OLD DHCP – This is optional
      9. OLD DHCP – Stop the service ” DHCP Server ” – Important to avoid conflicts
      10. OLD DHCP – remove the IP configuration from the server if no other service is running on the server – Important Optional if you want to re-use the same local IP address for the new DHCP server. Go to Network Connections —- Local Ethernet that is been used and set IPv4 to automatically, do the same for the DNS also ( You should already have a note of this IP address from step 3 )

      11. NEW DHCP – From the new VM re-IP to the IP from step 3 ( Ensure all changes is done and you can ping from the DC’s with the new VM name. once done move on
      12. NEW DHCP – ADD the DHCP Server Role and Authorize the new VM on your domain for DHCP once all done
      13. NEW DHCP – run cmd as an Administrator
      14. NEW DHCP – from cmd run ” netsh dhcp server Import C:\dhcpdata\olddhcp.dat All ” This will restore all information from your OLD DHCP environment to the new DHCP environment.
      15. Check and test
      16. Done

      This all can be done without seeing any down time

      Reply
  9. Edwards says:
    3 years ago

    1. Build a New VM and Join to the domain
    2. From the Old DHCP server ” Check to ensure DHCP is working as it should” If all is OK move to the next step
    3. Old DHCP – Make a Note of the IP address details
    4. OLD DHCP – Create a folder called ” dhcpdata ”
    5. OLD DHCP – run cmd as administrator
    6. OLD DHCP – from cmd run ” netsh dhcp server export C:\dhcpdata\olddhcp.dat All ” This will backup all information in the OLD DHCP environment.
    7. Copy the “dhcpdata” folder and it contents to the NEW VM C:\ This is the server that will be using for the NEW DHCP server
    8. OLD DHCP – Unauthorize the OLD DHCP – This is optional
    9. OLD DHCP – Stop the service ” DHCP Server ” – Important to avoid conflicts
    10. OLD DHCP – remove the IP configuration from the server if no other service is running on the server – Important Optional if you want to re-use the same local IP address for the new DHCP server. Go to Network Connections —- Local Ethernet that is been used and set IPv4 to automatically, do the same for the DNS also ( You should already have a note of this IP address from step 3 )

    11. NEW DHCP – From the new VM re-IP to the IP from step 3 ( Ensure all changes is done and you can ping from the DC’s with the new VM name. once done move on
    12. NEW DHCP – ADD the DHCP Server Role and Authorize the new VM on your domain for DHCP once all done
    13. NEW DHCP – run cmd as an Administrator
    14. NEW DHCP – from cmd run ” netsh dhcp server Import C:\dhcpdata\olddhcp.dat All ” This will restore all information from your OLD DHCP environment to the new DHCP environment.
    15. Check and test
    16. Done

    This all can be done without seeing any down time

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result
Zabbix server: More than 75% used in the trends cache
Monitoring

Zabbix server: More than 75% used in the trends cache

In Zabbix, "trends" are a type of data storage representing aggregated historical data. Zabbix monitors and collects a vast amount...

Read moreDetails
Check word count on Google Docs

Check word count on Google Docs

Zabbix server: More than 75% used in the configuration cache

Zabbix server: More than 75% used in the configuration cache

Approve updates in WSUS 2016

Approve updates in WSUS 2016

Configure Group Policy to deploy updates using WSUS 2016

Configure Group Policy to deploy updates using WSUS 2016

Configure computer groups in WSUS 2016

Configure computer groups in WSUS 2016

The initial configuration of WSUS 2016

The initial configuration of WSUS 2016

Get more stuff

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

we respect your privacy and take protecting it seriously

  • Contact
  • Homelab

© 2024 Dimitris Tonias

No Result
View All Result
  • About
  • Contact
  • Free Tools
  • Home
  • Homelab

© 2024 Dimitris Tonias

This website uses cookies. By continuing to use this website you are giving consent to cookies being used.