Migrating DHCP from WS2003 to WS2012 R2 with PowerShell on the source server throws a dhcp version conflict error. The recommendation is to use NetShell for the initial export and import .
1) Login to the current WS2003 DHCP Server and open a command prompt console as administrator.
2) Use the netshell dump command to verify the current dhcp server configuration and redirect to a text file if necessary. The dump file is human readable and gives you the option to select a few predetermined scopes:
C:\>netsh dhcp server \\dhcp00 dump > c:\dhcp\dhcpdump.txt
3) Using the netshell command, export the current dhcp server configuration as indicated in the screen shot. Please note that the export cmd needs to be run on the local server. You could check the help information on this cmd in the screen shot:
C:\>netsh dhcp server \\nts6 export c:\dhcpexportdb all
4) Copy the dhcp exportdb file to the WS2012 R2 server.
5) Configure a Static IP Address on the Target DHCP Server.
6) Install the DHCP Server role on the WS2012 R2using the PowerShell commands in the following screen shot:
Install-WindowsFeature -Name dhcp -IncludeAllSubFeature -IncludeManagementTools
7) After installing the service on the Target WS2012 R2 Server,stop it and delete or rename the current dhcp db file. Personally, I prefer to rename. Deleting is something I do only when extremely necessary:
8) Using the netshell command, import the exported dhcp db file as indicated:
C:\>netsh dhcp server \\dhcp00 import c:\dhcpexportdb
Review the new DHCP Server configuration to make sure all scope settings are available. If satisfactory, unauthorize the Windows Server 2003 DHCP and authorize the new server. Test to make sure that client dhcp discover requests are getting served properly on the new server (A quick ipconfig/release and ipconfig/renew will do. An ipconfig /all will show the dhcp server for the client) before shutting down DHCP Service on the old machine.
That’s it. It’s done. MS Technet has more information on WS 2012 R2 DHCP Service. I hope to write about WS 2012 R2 DHCP Failover in a future post.
You are my consultant
Lol. Thanks man.
While using NETSH to export/import DHCP provides and easy and fast way to do the job, it has some limitations:
1. It doesn’t export complex configurations – ex. multicast scopes.
2. If you are planning to configure DHCP Failover later, you will get error messages.
Using smigdeploy might seem more complex and harder to use, but IMHO that is a safer approach.
Regards,
Dean
Thank you for the feedback Dean. You are right in your assessment. I haven’t worked with the WS2012R2 migration tools yet. I plan to use it for File Services migration in the coming weeks. I’ll do some research with the Migration tool and post an update. Thanks again.