After you locate the backup copy of your DHCP database, take the following steps to restore the corrupt database:
- Use Win2K's Administrative Tools Services Console or NT 4.0's Control Panel Services applet to stop the DHCP service. Alternatively, you can issue the command
net stop dhcpserver
at a command prompt.
- To preserve the contents of the DHCP database folder, create a backup copy of the folder (\%systemroot%\system32\dhcp) in another location.
- Either use the DHCP Export Import (DhcpExim) utility to import the backup DHCP database, or copy the backup copy of the dhcp.mdb database file that's in the \%systemroot%\system32\dhcp\backup\jet\new folder to the primary DHCP database folder (\%systemroot%\system32\dhcp). You can also restore a backup copy of the database from an alternative source (e.g., a tape drive or other backup device, a replication partner server). However, use the direct file-copy method only if the two servers involved are running the same OS. For more information about the DhcpExim utility, see the sidebar "DhcpExim in Action."
- The DHCP service is still stopped, so take this opportunity to use the Jetpack utility to compact and verify the restored copy of the database. Go to a command prompt window, change to the \%systemroot%\system32\dhcp folder, and type
jetpack dhcp.mdb tmp.mdb
For more information about Jetpack, see the sidebar "Using Jetpack for Proactive Compacting," page 66.
- Restart the DHCP service.
The Microsoft article "How to Move a DHCP Database to Another Windows NT Server" (http://support.microsoft.com/support/kb/articles/q130/6/42.asp) recommends using the file-copy method rather than the DhcpExim utility when moving a database from an NT 4.0 system to a Win2K system. Don't follow this recommendation. For seamless cross-platform DHCP management and data migration, use the DhcpExim utility.
Regeneration Recovery
What can you do if you don't have a good backup of the DHCP configuration database? In that case, take the following steps to generate a new database from information stored in the registry:
- Stop the DHCP service through Win2K's Administrative Tools Services Console or NT 4.0's Control Panel Services applet or by issuing the command
net stop dhcpserver
at a command prompt.
- Move all files from the DHCP database folder (\%systemroot%\system32\dhcp) to another location, leaving an empty DHCP database folder in the original location.
- Restart the DHCP service.
This process causes DHCP to use the configuration information in the registry to regenerate the database.
After you complete this process, if you discover that your DHCP address-scope and address-reservation information is missing, you might need to take additional steps to complete the database recovery. In such cases, use the following procedure to restore a backup of the DHCP registry configuration data:
- Run regedt32.exe and navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Configuration registry subkey.
- Click the Configuration subkey to select it, then select Restore from the Registry menu.
- When prompted for the name of the file to restore, input (or browse to locate) \%systemroot%\system32\dhcp\backup\dhcpcfg.
- Click Yes when the system asks you to confirm that you want to restore over the existing subkey.
After you regenerate a DHCP database, the Win2K Microsoft Management Console (MMC) DHCP snap-in or the NT 4.0 DHCP Manager shows the IP address scopes but doesn't show any active client leases, which brings us to the final step in the database regeneration method: reconciling active leases. This procedure verifies client leases currently recorded in the database (none at this point) against those recorded in the registry. You must perform this process for each scope on the DHCP server.
To reconcile leases for a particular scope on an NT 4.0 DHCP server, select the scope, then select Scope\Active Leases from the menu. In the resulting dialog box, click Reconcile, then click OK. For Win2K servers, in the left pane of the DHCP snap-in, right-click the scope for which you want to reconcile leases and select Reconcile from the drop-down menu, as Figure 1 shows. You must repeat this procedure for each scope on the server.