How to take backup/restore for DHCP:

How to take backup for DHCP:

Backup: Path: %SystemRoot%\System32\DHCP\Backup

  1. In the DHCP console, right-click the server you want to back up, and then click Backup.
  2. In the Browse For Folder dialog box, select the folder that will contain the backup DHCP database, and then click OK.
Powershell:
Backup  : Backup-DhcpServer -path c:\DHCPBackup
Restore:  Restore-DhcpServer -ComputerName "dhcp2" -Path "C:Windows\system32\dhcp\backup*"

Registry keys that control the location and timing of DHCP backups, as well as other DHCP settings, are located under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters.

The following keys control the DHCP database and backup configuration:

  1. BackupDatabasePath Sets the location of the DHCP database. You should set this option through the DHCP Properties dialog box. Click the Advanced tab, and then set the Database Path field as appropriate.
  2. DatabaseName Sets the name of the primary DHCP database file. The default value is DHCP.mdb.
  3. Backuplnterval Determines how often the DHCP Client information database is backed up. The default is 60 minutes.
  4. DatabaseCleanuplnterval Determines how often the DHCP service deletes expired records from the DHCP client information database. The default is four hours.

To restore a backup copy of the DHCP database:

Simple recovery.

Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as Administrator.

Type net stop dhcpserver, and then press ENTER.

Type md c:\olddhcp, and then press ENTER.

Type move %SystemRoot%\system32\DHCP\*.* c:\olddhcp, and then press ENTER.

Type del %SystemRoot%\system32\DHCP\Dhcp.md, and then press ENTER.

Type copy%SystemRoot%\system32\dhcp\backup\jet\new\dhcp.mdb%SystemRoot%\system32\dhcp\dhcp.mdb, and then press ENTER.

Type net start dhcpserver, and then press ENTER.

After restoring scope information displayed in DHCP snapin seems inconsistent. To solve this inconsistency you reconsile your scope.

Advanced recovery. The registry can be modified to force creation of a new database file. This method can be useful as an additional method for data recovery when simple restoration of the database is not possible. However, this should be done with extreme caution. For more information about restoring a corrupted DHCP database, see the Microsoft Knowledge Base link on the Web Resources page at .

To move a DHCP database

  1. Stop the Microsoft DHCP service on the current computer.
  2. Copy the \System32\Dhcp directory to the new computer that has been configured as a DHCP server. Make sure the new directory is under exactly the same drive letter and path as on the old computer. If you must copy the files to a different directory, copy Dhcp.mdb, but do not copy the .log or.chk files.
  3. Start the Microsoft DHCP service on the new computer. The service automatically starts using the .mdb and .log files copied from the old computer.

When you check DHCP Manager, the scope still exists because the registry holds the information on the address range of the scope, including a bitmap of the addresses in use. You need to reconcile the DHCP database to add database entries for the existing leases in the address bitmask. As clients renew, they are matched with these leases, and eventually the database is again complete.

To reconcile the DHCP database

  1. In DHCP Manager, on the Scope menu, click Active Leases .
  2. In the Active Leases dialog box, click Reconcile .

Although it is not required, you can force DHCP clients to renew their leases in order to update the DHCP database as quickly as possible. To do so, type ipconfig/renew at the command prompt.

Repair corrupted DHCP database Event ID 1010, above steps we can follow up.

jetpack.exe” and “esentutl.exe“:

net stop dhcpserver
jetpack.exe dhcp.mdb temp.mdb

esentutl /p C:\windows\system32\dhcp\dhcp.mdb /t c:\windows\system32\dhcp\tmp.mdb