none
what is the correct way to capturing Windows 2012 R2 DHCP server configuration? RRS feed

  • Question

  • I am trying to migrate the DHCP service from Windows 2012 R2 to Windows 2016.

    I tried "<g class="gr_ gr_15 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="15" id="15">netsh</g> <g class="gr_ gr_16 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="16" id="16">dhcp</g> server dump" and "<g class="gr_ gr_17 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="17" id="17">netsh</g> <g class="gr_ gr_18 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="18" id="18">dhcp</g> server export", neither one of them captured all the configuration...because after I imported to the new server and compare, entries were missing.

    Thoughts/suggestions are greatly appreciated!

    Thanks....

    Monday, August 14, 2017 8:46 PM

Answers

  • Hi

    There are two methods to migrate DHCP, you could choose one of them.

    Use cmd

    1 Open DHCP mmc


    2 Open Command prompt: cmd


    3 Type: netsh dhcp server export C:\dhcp.txt all in command prompt and press Enter (domain A dhcp)

    4 Type: netsh dhcp server import C:\dhcp.txt all in command prompt and press Enter(domain B dhcp)


    5 Right-click server name within DHCP mmc and choose refresh


    More information about Using Netsh to export and import DHCP ,  please refer to the following article:

    http://windowsitpro.com/windows-server-2003-end-support/migrating-dhcp-server-2003-server-2012-r2

    Please Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party 
    contact information. 

    Use Powershell

    1. Log in with an administrator account to the Windows Server 2012 R2 system.

    2. Open Powershell and then type in the following command:

    Export-DhcpServer -File C:\DHCPdata.xml -Leases -Force -ComputerName old.network.local –Verbose
    3. Copy the file C:\DHCPdata.xml the Windows Server 2016 system.

    4. Install and configure the DHCP role on Server 2016 (Same Server 2012 R2 installation steps, Check my related article on DHCP Server 2012 R2 for help).

    5. Start the DHCP service.

    6. Type in the following command on Powershell to import the DHCP Data.

    Import-DhcpServer -File C:\DHCPdata.xml -BackupPath C:\DHCP\ -Leases -ScopeOverwrite -Force -ComputerName new.network.local –Verbose
    7. Restart the DHCP service.


    Best Regards,

    Frank

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, August 15, 2017 7:28 AM

All replies

  • this forum should stop formatting my text...i've tried to correct the modified text twice and it kept changing...
    Monday, August 14, 2017 8:49 PM
  • Monday, August 14, 2017 8:51 PM
  • Take a look at Export-DHCPServer and Import-DHCPServer cmdlets.

    Gleb.

    Tuesday, August 15, 2017 7:06 AM
  • Hi

    There are two methods to migrate DHCP, you could choose one of them.

    Use cmd

    1 Open DHCP mmc


    2 Open Command prompt: cmd


    3 Type: netsh dhcp server export C:\dhcp.txt all in command prompt and press Enter (domain A dhcp)

    4 Type: netsh dhcp server import C:\dhcp.txt all in command prompt and press Enter(domain B dhcp)


    5 Right-click server name within DHCP mmc and choose refresh


    More information about Using Netsh to export and import DHCP ,  please refer to the following article:

    http://windowsitpro.com/windows-server-2003-end-support/migrating-dhcp-server-2003-server-2012-r2

    Please Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party 
    contact information. 

    Use Powershell

    1. Log in with an administrator account to the Windows Server 2012 R2 system.

    2. Open Powershell and then type in the following command:

    Export-DhcpServer -File C:\DHCPdata.xml -Leases -Force -ComputerName old.network.local –Verbose
    3. Copy the file C:\DHCPdata.xml the Windows Server 2016 system.

    4. Install and configure the DHCP role on Server 2016 (Same Server 2012 R2 installation steps, Check my related article on DHCP Server 2012 R2 for help).

    5. Start the DHCP service.

    6. Type in the following command on Powershell to import the DHCP Data.

    Import-DhcpServer -File C:\DHCPdata.xml -BackupPath C:\DHCP\ -Leases -ScopeOverwrite -Force -ComputerName new.network.local –Verbose
    7. Restart the DHCP service.


    Best Regards,

    Frank

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, August 15, 2017 7:28 AM
  • Frank.

    I just want to say thank you for the explicit instructions on TWO SEPARATE methods of how to export/import DHCP settings.

    Just want to note a few things:
    - the Command Prompt method doesn't work, it doesn't import all the settings, as stated in my initial post.
    - PowerShell method worked for me, despite showing me the following error during import

    Wednesday, August 16, 2017 5:36 PM