Migrating the DHCP service from Windows 2003 to Windows 2016

Good! Nothing, I wanted to share with you a little fight I had in a summer project, among several things he had to migrate a Windows DHCP server 2003 to Windows 2016 Server, I share with you the steps I followed to migrate it to the new server in less than a crows! Think of each DHCP environment, with each rank, with all the exclusions, Customizations… How to avoid resetting it!

 

We perform the installation of the DHCP Server role on the new Windows server 2016, and we don't do more, We close the installation wizard and start!

The process can be as simple as executing two commands, one on the source server that will export a copy with all the settings:

[SourceCode]netsh dhcp server export C:\copia_servidor_dhcp.dat all[/SourceCode]

 

We copy the exported file to the new server, and from a DOS window of the 2016, Run:

[SourceCode]netsh dhcp server import C:\copia_servidor_dhcp.dat all[/SourceCode]

 

If everything went well and you don't have mistakes, ready! All you have to do is restart the DHCP service, authorize the 2016 and disavowing the 2003.

 

Eye, that if we have errors of the style: Class Import Error “Default routing and remote access class.”
This class conflicts with the existing class “Default Routing and Remote Access Class.” or similar we will have to take some additional steps… it is usually common because the server has a different language or because it makes such large jumps.

 

We create a dump with all the DHCP Server settings 2003, from a DOS we run:

[SourceCode]NETSH DHCP SERVER DUMP > Clases_viejas.txt[/SourceCode]

 

Now we do the same thing but on the DHCP Server 2016, we also run in another DOS window:

[SourceCode]NETSH DHCP SERVER DUMP > Clases_nuevas.txt[/SourceCode]

 

GOOD, it would be a matter of opening both TXT files with a text editor and observing the Classes part, Here we are going to make a correction, since we are going to delete the current classes from the server 2003 and we are going to replace them with those of the 2016. So we created a new TXT file, We paste the classes from the server 2003, we add to each NETSH line at the beginning, and we substituted the 'Add’ by 'Delete'. Next, we paste the classes of the 2016, we add the word NETSH at the beginning of each line and correct the server name, indicating the IP address of the server 2003.

This would be an example, we could run it directly on the DOS server 2003 or make a .bat file and run it!

[SourceCode]#Eliminate:
NETSH Dhcp Server 10.123.18.2 Delete Class "Default BOOTP Class" "User class for BOOTP clients" 424f4f54502e4d6963726f736f6674 0 b
NETSH Dhcp Server 10.123.18.2 Delete Class "Default Routing and Remote Access Class " "User Class for Remote Access Clients " 525241532e4d6963726f736f6674 0 b
NETSH Dhcp Server 10.123.18.2 Delete Class "Microsoft Options"" "Microsoft vendor-specific options applicable to Windows customers 98 and Windows 2000" 4D534654 1 b
NETSH Dhcp Server 10.123.18.2 Delete Class "Microsoft Windows Options" 2000 " "Microsoft vendor-specific options for Windows 2000 customers" 4D53465420352E30 1 b
NETSH Dhcp Server 10.123.18.2 Delete Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 customers" 4d534654203938 1 b

#Add:
NETSH Dhcp Server 10.123.18.2 Add Class "Default routing and remote access class" "User Class for Remote Access Clients " 525241532e4d6963726f736f6674 0 b
NETSH Dhcp Server 10.123.18.2 Add Class "Default BOOTP Class" "User class for BOOTP clients" 424f4f54502e4d6963726f736f6674 0 b
NETSH Dhcp Server 10.123.18.2 Add Class "Microsoft Windows Options" 2000 " "Microsoft vendor-specific options for Windows customers 2000 and later versions" 4D53465420352E30 1 b
NETSH Dhcp Server 10.123.18.2 Add Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 customers" 4d534654203938 1 b
NETSH Dhcp Server 10.123.18.2 Add Class "Microsoft Options"" "Microsoft vendor-specific options applicable to all Windows customers" 4D534654 1 b[/SourceCode]

 

Now we can export the configuration back to the old DHCP server:

[SourceCode]netsh dhcp server export C:\copia_servidor_dhcp.dat all[/SourceCode]

 

And we end up copying the file to the server 2016 and run the following to import it!

[SourceCode]netsh dhcp server import C:\copia_servidor_dhcp.dat all[/SourceCode]

 

We restart the DHCP Service and that's it!

We will be able to verify how we already have all the settings running under 2016, We continue to authorize the server and stop the old server!! I hope it has been useful to you!

 

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!