Backing Up the DHCP Database

The DHCP Server service automatically performs a backup of the DHCP database and DHCP Server registry configuration key every 60 minutes (and overwrites the previous back up). You can also perform a manual backup as outlined in the GUI solution. Backup files are stored in %SystemRoot%\system32\dhcp\backup by default, but you can change that location as described in the CLI solution. You should change this path to another drive so that a disk failure doesn’t impact both the active database and the backup files.

The DHCP Server takes care of performing regular database backups, but you’ll still need to use a backup tool such as NTBackup to archive those backups on a regular basis. As long as you are backing up the %SystemRoot%\system32\dhcp directory and the system state (which includes the registry), you can restore the database and server configuration on the same server or on another server if necessary.

Using a graphical user interface

  1. Open the DHCP snap-in on the target DHCP Server.
  2. In the left pane, click the server node.
  3. From the menu, select Action Backup.
  4. Select the folder to store the backup files in and click OK.

Using a command-line interface

You can’t initiate a backup from netsh, but you can configure how frequently the automatic backups occur and where backup files are stored. The following command changes the default backup time to 24 hours (1,440 minutes):

> netsh dhcp server set databasebackupinterval 1440

The following command changes the backup location to d:\dhcp\backups:

> netsh dhcp server set databasebackuppath d:\dhcp\backups

You can also dump the DHCP Server configuration to a text file and import it later using netsh. Here is how you export it:

> netsh dhcp server dump > dhcpconfig.dmp

The dump option does not export any lease information.