Microsoft product support team often encounters migrated DHCP servers which are dysfunctional. The reason quite often for the bad state of the DHCP server is because backup/restore has been used by the customers for migrating the DHCP server across server versions (e.g. migrating from Windows Server 2003 DHCP to Windows Server 2008). Backup and Restore are not expected to work across server versions as the DHCP database format has changed between Windows Server 2003 and Windows Server 2008.
The recommended procedure for DHCP server migration is to use the export import commands through netsh. Following is the procedure for migrating DHCP server from Windows Server 2003 to Windows Server 2008 outlined in brief:
Export the DHCP database from the server that is running Microsoft Windows Server 2003
To migrate a DHCP database and configuration from a server that is running Windows Server 2003 to another server that is running Windows Server 2003:
1. Log on to the source DHCP server by using an account that is a member of the local Administrators group or the DHCP Administrators group
2. Click Start, click Run, type cmd in the Open box, and then click OK.
3. Type netsh dhcp server export C:\dhcpdatabase.dat all, and then press ENTER.
Note: While the export command runs, DHCP server is stopped and does not respond to clients seeking new leases or lease renewals.
At the end of this step, you will have the DHCP configuration as well as address lease information exported into the dhcpdatabase.dat file. You can now stop the DHCP service on the source server.
Install the DHCP server service on the server that is running Windows Server 2008
To install the DHCP Server service on an existing Windows Server 2008 computer:
1. Start Server Manager.
2. Click on Add Roles.
3. Select the DHCP server role and press Next.
4. Click through the next sequence for screens of the installation wizard to complete the DHCP server installation. You should not authorize the DHCP server at this point.
Import the DHCP database
1. Log on as a user who is a member of the local Administrators group or DHCP administrators group.
2. Copy the exported DHCP database file to the local hard disk of the Windows Server 2008 computer.
3. Verify that the DHCP service is started on the Windows Server 2008 computer.
4. Click Start, click Run, type cmd in the Open box, and then click OK.
5. At the command prompt, type netsh dhcp server import c:\dhcpdatabase.dat all, and then press ENTER, where c:\dhcpdatabase.dat is the full path and file name of the database file that you copied to the server.
6. After you receive the message that the command completed successfully, quit the command prompt.
Authorize the DHCP server
1. Click Start, point to All Programs, point to Administrative Tools, and then click DHCP. You must be logged on to the server by using an account that is a member of the Administrators group. In an Active Directory domain, you must be logged on to the server by using an account that is a member of the Enterprise Administrators group.
2. In the console tree of the DHCP snap-in, expand the new DHCP server. If there is a red arrow in the lower-right corner of the server object, the server has not yet been authorized.
3. Right-click the server object, and then click Authorize.
4. After several moments, right-click the server again, and then click Refresh. A green arrow indicates that the DHCP server is authorized.
While the netsh export command exports the lease database as well as the configuration of the DHCP server, the DHCP server registry settings are not handled by export/import. Attached with this post is a tool which will help you migrate all the DHCP configuration including the registry settings. Type dhcmpmig -help for usage information on the tool.
The scripted tool (bat file) is provided on an "as is" basis and not supported by Microsoft.
DHCP Server Team
Does the script work from Server 2003 to another Server 2003? We're decomissioning a server soon.
You could try Backup Restore if not migrating across different server versions.
But I'll assume the above procedure also works?
Hi Gis, I use this netsh method to backup (and restore to the new server if needed) Windows 2003 DHCP server. It works, tested.
I don't think it works from win2k3 to win2k8 Server Core. Some one can test it out.
Are you talking about the migration script?
Can you please send me the copy of the error message you got so that I can look into that?
I tried once today and the migration succeeded.
Watch the demo of DHCP Server migration using the new Server Migration Tools on Windows Server 2008 R2 http://edge.technet.com/Media/Migrating-DHCP-using-the-Windows-Server-2008-R2-Migration-Tools/
what are the differences between export/import and backup/restore?
Export/ Import is the way to migrate from one OS version to another. Backup restore is supported only across similar OS versions.
followed the article in full, all was successful. after the migration is complete, clients are not able to pick up IP leases, just dont see the DHCP server on the network
i have server on one subnet and clients on a different one, what should i keep in mind?
I have been tasked to Migrate DHCP from Win 2003 R2 STED 32 bit TO Win 2008 R1 ST ED 32 BIT.
I have found this article very useful - Thanks!
However I have few questions.
1. The attachment DhcpMig.zip is setting some environment variables:
a) How do I use this to pull out what i need from the registry?
2. Given the Windows Server Migration Tools (WSMT) - as per a comment from the article.
a) Would this be a "safer" OR better put a MS best practice way of Migrating the DHCP scopes?
b) In your opinion, given that I will be decomissioning the servers, would installing this WSMT be more trouble than its worth? IF however this would be MS preferred way of undertaking the migration, ie avoiding any special tweaks for example the registry stuff, then this would be my preference.
Your advice on the above would be greatly appreciated.
#1 the tool pulls out all the DHCP specific registry settings.
#2 WSMT is the preferred way if you are migrating to Windows Server 2008 R2. It is not available on Windows Server 2008.
Thank you for a short reminder to shift Acive Directory
What is the process to kick out the DHCP config to say.... A CSV file? WOuld like to keep this information outside of the DHCP server incase of a complete loss, this way we have some reference point with a new fresh DHCP system.