Migrating the Windows DHCP role between languages, versions and architectures

By YellowOnline on Monday 26 October 2015 11:38 - Comments (2)
Categories: Networking, Windows, Views: 12.801

I'm moving a lot of DCs from Server 2003 to Server 2008 R2. The original machines are in Dutch, French, Spanish, Italian, German and Polish - but I want the whole backend to be in English. The following procedure worked out fine, even though it is not for the faint-hearted. I did one move to Server 2012R2 as well this way, so it isn't limited to 2008 R2.


There used to be a Microsoft KB containing this information (KB885687), but it seems to be no longer there.

Step 1: Export the DHCP dump from the source DHCP server

code:
1
NETSH DHCP SERVER DUMP > TheLanguageIWantToGetRidOf.txt



Step 2: Export the DHCP dump from the target DHCP server

code:
1
NETSH DHCP SERVER DUMP > TheLanguageIWantToItToBe.txt



Step 3: Compare the classes
We only need to compare the classes part of the two dumps.

Old languages

code:
1
2
3
4
5
Dhcp Server 172.18.0.141 Add Class "Standardrouting- und RAS-Klasse" "Benutzerklasse RAS-Clients" 525241532e4d6963726f736f6674 0 b
Dhcp Server 172.18.0.141 Add Class "Standard BOOTP-Klasse" "Benutzerklasse BOOTP-Clients" 424f4f54502e4d6963726f736f6674 0 b
Dhcp Server 172.18.0.141 Add Class "Microsoft Windows 2000-Optionen" "Herstellerspezifische Optionen fr Microsoft Windows 2000-Clients" 4d53465420352e30 1 b
Dhcp Server 172.18.0.141 Add Class "Microsoft Windows 98-Optionen" "Herstellerspezifische Optionen fr Microsoft Windows 98-Clients" 4d534654203938 1 b
Dhcp Server 172.18.0.141 Add Class "Microsoft-Optionen" "Herstellerspezifische Optionen fr Microsoft Windows 98- und Windows 2000-Clients" 4d534654 1 b



New languages

code:
1
2
3
4
5
Dhcp Server 172.2.0.100 Add Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b
Dhcp Server 172.2.0.100 Add Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b
Dhcp Server 172.2.0.100 Add Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 Clients" 4d53465420352e30 1 b
Dhcp Server 172.2.0.100 Add Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 Clients" 4d534654203938 1 b
Dhcp Server 172.2.0.100 Add Class "Microsoft Options" "Microsoft vendor-specific options applicable to Windows 98 and Windows 2000 Clients" 4d534654 1 b



Yep, that's twice the same but in different languages.

Step 4: Replace classes
Now we need to delete the classes in the old language (German here) and add the same ones in the new language (English here). Just Copy/Paste the aforementioned classes and add the NETSH command (don't miss the DELETE or ADD behind the IP address). Also adapt the IP Address so the old one does not get the new IP addresses (because we will first change the old DHCP server!)


code:
1
2
3
4
5
6
7
8
9
10
11
12
13
#Remove
NETSH Dhcp Server 172.18.0.141 DELETE Class "Standardrouting- und RAS-Klasse" "Benutzerklasse RAS-Clients" 525241532e4d6963726f736f6674 0 b
NETSH Dhcp Server 172.18.0.141 DELETE Class "Standard BOOTP-Klasse" "Benutzerklasse BOOTP-Clients" 424f4f54502e4d6963726f736f6674 0 b
NETSH Dhcp Server 172.18.0.141 DELETE Class "Microsoft Windows 2000-Optionen" "Herstellerspezifische Optionen fr Microsoft Windows 2000-Clients" 4d53465420352e30 1 b
NETSH Dhcp Server 172.18.0.141 DELETE Class "Microsoft Windows 98-Optionen" "Herstellerspezifische Optionen fr Microsoft Windows 98-Clients" 4d534654203938 1 b
NETSH Dhcp Server 172.18.0.141 DELETE Class "Microsoft-Optionen" "Herstellerspezifische Optionen fr Microsoft Windows 98- und Windows 2000-Clients" 4d534654 1 b

#Add
NETSH Dhcp Server 172.18.0.141 ADD Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b
NETSH Dhcp Server 172.18.0.141 ADD Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b
NETSH Dhcp Server 172.18.0.141 ADD Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 Clients" 4d53465420352e30 1 b
NETSH Dhcp Server 172.18.0.141 ADD Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 Clients" 4d534654203938 1 b
NETSH Dhcp Server 172.18.0.141 ADD Class "Microsoft Options" "Microsoft vendor-specific options applicable to Windows 98 and Windows 2000 Clients" 4d534654 1 b



Even if you never scripted before, you should be able to see what's happening here. Save as a .bat and run it.

Step 5: Export the DHCP DB
The database - not the dump. Slightly different command.

code:
1
NETSH DHCP SERVER EXPORT C:\Temp\MyPreciousDHCPDB.txt ALL



Step 6: Import the DHCP DB
Based on step 5, can you guess the command to import the file on the new DHCP server? Of course you do:

code:
1
NETSH DHCP SERVER IMPORT C:\Temp\MyPreciousDHCPDB.txt ALL



Step 7: Restart the updated DHCP service
Step 8: Remove DHCP from the old server
Step 9: Authorize the new DHCP server
There's not much to say about these three final steps.

----------------

Edit
What happens if you try to export/import the DB if you don't sanitise for language first?

This:
Error while importing class “Default BOOTP Class”. This class conflicts with the existing class “Default BOOTP Class”.

Volgende: Koken! Hartige pannenkoeken 10-'15 Koken! Hartige pannenkoeken
Volgende: Powershell: Check MAC Address in range 09-'15 Powershell: Check MAC Address in range

Comments


By Tweakers user walteij, Monday 26 October 2015 16:01

As a last line, I would add: in case of multiple VLANs or multiple scopes, change IP helper (or DHCP relay agent) on your switches to point to the new DHCP server.
If you don't change this, only the subnet where the DHCP server is located will be able to reach the new DHCP server.

By Tweakers user erwin80, Tuesday 27 October 2015 19:30

please also note there is a bug in the 2008 dhcp server which causes some dhcp option values to be truncated when exporting from 2008 to 2012. Or it was hex values which were read as decimal. Cost me a couple of hours debugging :)

In order to comment on this post you need to be logged in. Use this link to log in when you are already a registered user. If you don't have an account you can create one here.