Freigeben über


Migration of DHCP Server from Windows Server 2003 to Windows Server 2008

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.

Prasad

DHCP Server Team

DhcpMig.zip

Comments

  • Anonymous
    January 01, 2003
    Hey Gis, You could try Backup Restore if not migrating across different server versions. Raunak Pandya DHCP Server Team

  • Anonymous
    January 01, 2003
    Hi, 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? http://technet.microsoft.com/en-us/library/dd379545%28WS.10%29.aspx 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. Thanks Sam
  • Anonymous
    January 01, 2003
    If the netsh command never captured the registry information, it leads me to ask why is what's contained in the registry important?  I'm working on a 2k3 sp2 to 2k8r2 migration right now and see no problem in just using the netsh command to export from 2k3 and netsh command to import into 2k8 R2. Further where can i find the DHCP registry information?

  • Anonymous
    January 01, 2003
    Hi Abdul, 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. Thanks, Pandian DHCP Server Team

  • Anonymous
    January 01, 2003
    Export/ Import is the way to migrate from one OS version to another. Backup restore is supported only across similar OS versions. Thanks Raunak Pandya DHCP Server Team

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    Thank you for a short reminder to shift Acive Directory

  • Anonymous
    January 01, 2003
    Hi Sam, #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. Thanks, Prasad Team DHCP

  • Anonymous
    January 01, 2003
    Hi Dean, Both methods are supported for Win 2003 DHCP to Win 2008R2 migration. Some differentiating points are:-

  1. With WSMT one can migrate other supported server roles also along with DHCP Server.
  2. WSMT can take care of installation of server role also if not present.
  3.  WSMT will migrate registry settings also. Thanks, Vikas
  • Anonymous
    January 01, 2003
    Dean, For managing a server you should have the respective client version also i.e for Win20008R2 you should have windows 7Win2008R2.Others are not a supported. But a Windows7Win2008R2 can be used to control Win2k3Windows Server 2008 MMC also. Vikas

  • Anonymous
    January 01, 2003
    Like Ryan15, I too wonder about the Registry information. If netsh does not capture the registry info, then how is that relevant to a 2003 to 2008 R2  DHCP Migration.

  • Anonymous
    January 01, 2003
    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/ Thanks, Prasad

  • Anonymous
    January 01, 2003
    Hi Kevin, You can use the dump command in netsh for getting the configuration into a file. The format is not csv though it would serve the purpose you mentioned above. Thanks, Prasad Team DHCP

  • Anonymous
    January 01, 2003
    i have server on one subnet and clients on a different one, what should i keep in mind?

  • Anonymous
    January 01, 2003
    I am having issues importing DHCP from a server 2k3 x86 to a server 2k8 R2 x64 server. the export goes fine but when I go to import it it says the mig file is not accessible I am using the same Admin account on both servers so I know I have rights to the file, the file is on the hard drive of my 2k8 R2 server so I know my path is right .  im honestly at a loss at this point I have followed the instructions and video's to a T and it just wont Import DHCP. any help would be great Thanks Ryan

  • Anonymous
    February 18, 2009
    Does the script work from Server 2003 to another Server 2003? We're decomissioning a server soon.

  • Anonymous
    February 19, 2009
    But I'll assume the above procedure also works?

  • Anonymous
    February 20, 2009
    Hi Gis, I use this netsh method to backup (and restore to the new server if needed) Windows 2003 DHCP server. It works, tested.

  • Anonymous
    March 06, 2009
    I don't think it works from win2k3 to win2k8 Server Core. Some one can test it out. Thanks Abdul Rahiman

  • Anonymous
    May 13, 2009
    Hi, what are the differences between export/import and backup/restore?

  • Anonymous
    April 09, 2010
    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. Thanks, KW

  • Anonymous
    September 30, 2010
    If migrating from Win 2003 DHCP to Win 2008R2 Can you please explain the benefits of using the WSMT approach i.e. the powershell script over the traditional netsh import / export method?   Can you also confirm if both methods are supported from a Micrsoft perspective?  I note that the WSMT approach takes considerably longer to complete... Thanks in advance.

  • Anonymous
    October 04, 2010
    Excellent, thanks Vikas.   One last question if I may, since upgrading our Domain Controllers to Win2008R2 we have noticed that we are no longer able to view DHCP Reservations from a WinXP / 2003 client, nothing is displayed however, when I connect to the W2008 Server direct the reservations are visible.. Is their a known issue with the MMC Snapin for XP/2003?

  • Anonymous
    March 16, 2011
    Hi, I need to make sure of one thing. I am assigned the responsibility of move the current DHCP Server function from a Windows 2003 32b to another server with Windows 2008 32b. To my question, will the solution explained here include everything = scopes, pools, current adress leases, reservations, scope options. Eventually Server options. I would greatly appreciate a fast answer as I have to handle this within the next few weeks. Regards, /Mikael