Recipe14.14.Backing Up the DHCP Database


Recipe 14.14. Backing Up the DHCP Database

Problem

You want to back up the DHCP database.

Solution

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

    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.


Using VBScript

See the Introduction for more information on how to run the netsh command from within a script.

Discussion

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.

See Also

Recipe 14.15, Recipe 14.16, MS KB 173396 (How to Restore a Corrupted DHCP Database File), and MS KB 325473 (How to move a DHCP database to a computer that is running Windows Server 2003)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net