How to Move a DHCP Database to Another Windows Server (Q130642)


The information in this article applies to:



IMPORTANT : This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
Q256986 Description of the Microsoft Windows Registry

SUMMARY

Windows provides administration utilities for Dynamic Host Configuration Protocol (DHCP) you can use to manage DHCP servers. DHCP Manager (Dhcpadmn.exe) is provided in Windows NT while the DHCP Snap-in is provided as part of the Microsoft Management Console in Windows 2000. Neither utility permits you to move a DHCP database from one server to another server.

This article explains how to move a database from a server to another server. There are three sections to this article, and each section should be treated independently. Make sure to only use the section that corresponds to the type of migration you want to do.

With the release of the Windows 2000 Resource Kit Supplement 1 the processes described in the document can also be accomplished through a new tool called DHCPExIm.exe.

The DHCP Export Import tool allows you to move any combination of scopes between microsoft dhcp servers. The utility will move scopes from Windows NT 4 to Windows NT 4, from Windows NT 4 to Windows 2000, and from Windows 2000 to Windows 2000. Moving all your scopes with this tool is equivalent to moving the database.

DHCPExIm.exe can be found in the Windows 2000 Resource Kit Supplement 1. Please note that it is not listed in the alphabetical list of tools. Instead, refer to the readme for instructions on using it.


MORE INFORMATION

WARNING : If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Windows NT 4.0 (Source) to Windows NT 4.0 (Destination)

To move a DHCP database from a Windows server to another Windows server:

IMPORTANT : Moving a DHCP Database incorrectly can leave your computer in an unstable state. Because of this, it is strongly recommended that before you try to perform a database migration you should: NOTE : It is possible that on the source server the DHCP database name and location have been changed from the default of %SystemRoot%\System32\Dhcp\Dhcp.mdb. This migration procedure is not affected by differences in database location between source and destination servers, and will require the destination DHCP server to use the default name and path settings of %SystemRoot%\System32\Dhcp\Dhcp.mdb.

Also, several of the following steps state that commands such as net stop dhcpserver should be run. You should run these commands at a command prompt.

From the Source DHCP Server

  1. To prevent DHCP from starting after the database has been transferred, disable the DHCP Server service by using the Services tool in Control Panel:

    1. Click Start , point to Settings , click Control Panel , and then double-click Services .

    2. In the Services box, click Microsoft DHCP Server , click Startup , and then click Disabled under Startup Type .

  2. Stop the DHCP Server service by using the net stop dhcpserver command at a command prompt.

  3. Copy the DHCP folder tree (%SystemRoot%\system32\Dhcp) to the destination DHCP server, and then save it to the C:\Temp\Dhcp folder.

From the Destination DHCP Server

  1. If you have not already installed the DHCP Server software, install the DHCP Server service from the Services tab in the Network tool in Control Panel.

  2. Stop the DHCP Server service.

  3. If you are running Windows NT 4.0 or later, skip to step 4.

    WARNING : In Windows NT 3.5, copying the System.mdb file from one computer to another can cause problems.

    If you are running Windows NT 3.51, rename the C:\Temp\DHCP\System.mdb file to C:\Temp\DHCP\System.src.

  4. Delete all of the contents of the %systemroot%\system32\dhcp folder, including its subfolders.

  5. Copy the DHCP directory tree from the C:\Temp\DHCP folder to the %SystemRoot%\system32\DHCP folder to replace the existing DHCP folder.

  6. Use Registry Editor (Regedt32.exe) to view the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration
  7. Click the Configuration key, and then click Restore on the Registry menu.

  8. When you are prompted for the file name, choose %SystemRoot%\System32\Dhcp\Backup\Dhcpcfg.

  9. When you are prompted to restore over the existing key, click Yes .

    NOTE : If you receive the following error message

    Registry editor could not accomplish the requested operation.
    refer to the following Microsoft Knowledge Base articles to determine the help determine the cause of the error:
    Q139600 Registry Editor Save Key Saves Key on Wrong Computer
    Q158294 Registry Editor Could Not Accomplish the Requested Operation
  10. Quit Registry Editor, start the DHCP service, and then start the DHCP Manager tool.

  11. Double-click a scope to view the Active Leases dialog box. Click Reconcile to synchronize the database with the registry, and then repeat this procedure until you have performed it on all of the scopes.

Windows NT 4.0 (Source) to a Server Running a Later Version of Windows (Destination)

To move a DHCP database from a Windows NT 4.0 Server to a Windows 2000-based server:

IMPORTANT : Moving a DHCP Database incorrectly can leave your computer in an unstable state. Because of this, it is strongly recommended that before you try to perform a database migration you should: Also, it is assumed the destination server does not have the DHCP Server service installed. If the DHCP Server service has been installed, it must be removed. To do so:
  1. Click Start , point to Settings , click Control Panel , and then double-click Add/Remove Programs .

  2. Click Add/Remove Windows Components , double-click Networking Services (the words, not the check box), and then click to clear the DHCP Server check box.

After you have installed the DHCP Server service on the destination server, it is important that you do not start the DHCP MMC until you are instructed to do so. The first time you start the MMC, it checks for and creates certain settings that should only be created at the end of the procedures listed below.

NOTE : It is possible that on the source server the DHCP database name and location have been changed from the default of %SystemRoot%\System32\Dhcp\Dhcp.mdb. This migration procedure is not affected by differences in database location between source and destination servers, and will require the destination DHCP server to use the default name and path settings of %SystemRoot%\System32\Dhcp\Dhcp.mdb.

Also, this method will not migrate the following DHCP Server settings: After your migration is successful you can change any of these settings by using the DHCP Snap-In under Server Properties.

From the Source DHCP Server

  1. To prevent DHCP from starting after the database has been transferred, disable the DHCP Server service by using the Services tool in Control Panel:

    1. Click Start , point to Settings , click Control Panel , and then double-click Services .

    2. In the Services box, click Microsoft DHCP Server , click Startup , and then click Disabled under Startup Type .

  2. Stop the DHCP Server service by using the net stop dhcpserver command at a command prompt.

  3. Use Registry Editor (Regedt32.exe) to view the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration
  4. Select the Configuration key, click Save Key on the Registry menu, and then save the key as c:\config.key.

On the Destination DHCP Server

  1. Install the DHCP Server service:

    1. Click Start , point to Settings , click Control Panel , and then double-click Add/Remove Programs .

    2. Click Add/Remove Windows Components , double-click Networking Services (the words, not the check box), and then click to select the Dynamic Host Configuration Protocol (DHCP) check box.

  2. Stop the DHCP Server service by using the net stop dhcpserver command.

  3. Copy the Config.key file to the destination server, and save the file as c:\Config.key.

  4. Use Registry Editor (Regedt32.exe) to view the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DhcpServer\Configuration
  5. Select the Configuration key, and then click Restore on the Registry menu. Name the file C:\Config.key, and when you are prompted to restore over the existing key, click Yes .

  6. Delete all of the contents of the %SystemRoot%\System32\Dhcp folder, including its subfolders.

  7. Copy the DHCP database file (Dhcp.mdb) from the %SystemRoot%\System32\Dhcp folder on the source server to the %SystemRoot%\System32\Dhcp folder on the destination server.

  8. Start the DHCP Server service with the net start dhcpserver command.

    IMPORTANT : You should receive the following error message:

    System error 20036 has occurred. The system cannot find message text for message number 0x4e44 in the message file for BASE.
    Receiving this error message is normal, please proceed to the next step.

  9. If you also receive the following error message, copy the Edb500.dl_ file from the Windows 2000 CD-ROM, expand it to the System32 folder, repeat step 6, and when you no longer receive this error message, continue to the next step.

    Jet Conversion Process
    The conversion was not successful! The conversion tool could not locate a file called edb500.dll which is required for the conversion. This file should be present on your Windows CD-ROM. Please copy it to your SystemRoot\System32 folder (it may need to be uncompressed) and re-start.
    NOTE : This also corresponds with an EventID 1008 in the Application log.

  10. If you receive no additional error messages, check the Application Log in the Event Viewer. If the JetConv tool logs EventID 1000, the database has been converted successfully.

  11. Start the DHCP Server snap-in from the Administrative Tools group.

  12. Click the destination DHCP server, and then click Reconcile All Scopes on the Action menu. Click Verify . If any leases need to be reconciled, click Reconcile to synchronize the registry and database.

  13. If the Windows 2000-based server is part of an Active Directory domain, the server must be Authorized.

Windows 2000 (Source) to Windows 2000 (Destination)

To move a DHCP database from a Windows 2000 Server to another Windows 2000 Server:

IMPORTANT : Moving a DHCP Database incorrectly can leave your computer in an unstable state. Because of this, it is strongly recommended that before you try to perform a database migration you should: Also, it is assumed the destination server does not have the DHCP Server service installed. If the DHCP Server service has been installed it must be removed. To do so:
  1. Click Start , point to Settings , click Control Panel , and then double-click Add/Remove Programs .

  2. Click Add/Remove Windows Components , double-click Networking Services (the words, not the check box), and then click to clear the DHCP Server check box.

After you have installed the DHCP Server service on the destination server, it is important that you do not start the DHCP MMC until you are instructed to do so. The first time you start the MMC, it checks for and creates certain settings that should only be created at the end of the procedures listed below.

NOTE : It is possible that on the source server the DHCP database name and location have been changed from the default of %SystemRoot%\System32\Dhcp\Dhcp.mdb. This migration procedure is not affected by differences in database location between source and destination servers, and will require the destination DHCP server to use the default name and path settings of %SystemRoot%\System32\Dhcp\Dhcp.mdb.

Also, several of the following steps state that commands such as net stop dhcpserver should be run. You should run these commands at a command prompt.

NOTE : This method does not migrate the following DHCP Server settings:

After your migration is successful, you can change any of these settings by using the DHCP Snap-In under Server Properties.

From the Source DHCP Server

  1. To prevent DHCP from starting after the database has been transferred, disable the DHCP Server service by using the Services tool in Control Panel:

    1. Click Start , point to Settings , click Control Panel , and then double-click Services .

    2. In the Services box, click Microsoft DHCP Server , click Startup , and then click Disabled under Startup Type .

  2. Stop the DHCP Server service by using the net stop dhcpserver command at a command prompt.

  3. Use Registry Editor (Regedt32.exe) to view the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DhcpServer\Configuration
  4. Select the Configuration key, and then click Save Key on the Registry menu. Save the key as C:\Config.key.

On the Destination DHCP Server

  1. Install the DHCP server service:

    1. Click Start , point to Settings , click Control Panel , and then double-click Add/Remove Programs .

    2. Click Add/Remove Windows Components , double-click Networking Services (the words, not the check box), and then click to select the Dynamic Host Configuration Protocol (DHCP) check box.

  2. Use the net stop dhcpserver command to stop the DHCP Server service.

  3. Copy the Config.key file to the destination server, and save the file as C:\Config.key.

  4. Use Registry Editor (Regedt32.exe) to view the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DhcpServer\Configuration
  5. Select the Configuration key, and then click Restore on the Registry menu. Save the file as c:\Config.key, and when you are prompted to restore over the existing key, click Yes .

  6. Delete all of the contents of the %SystemRoot%\System32\Dhcp folder, including its subfolders.

  7. Copy the DHCP database file (Dhcp.mdb) from the %SystemRoot%\System32\Dhcp folder on the source server to the %SystemRoot%\System32\Dhcp folder on the destination server.

  8. Use the net start dhcpserver command to start the DHCP Server service. You should receive the following message:

    The DHCP Server service was started successfully
  9. Start the DHCP Server snap-in from the Administrative Tools group.

  10. Click the destination DHCP server, and then click Reconcile All Scopes on the Action menu. Click Verify . If any leases need to be reconciled, click Reconcile to synchronize the registry and database.

  11. If the Windows 2000-based server is part of an Active Directory domain, the server must be Authorized.