Monday, September 15, 2014

DHCP Backup and Restore with Windows Server 2012

The DHCP database is a dynamic database containing data that is related to scopes, address leases, exclusions and IP reservations.

By default, the DHCP database files are stored in the %systemroot%\System32\Dhcp folder.

You can back up a DHCP database manually, or you can configure it to back up automatically. An
automatic backup is called a synchronous, A manual backup is called an asynchronous backup.

Using Netsh (You can also use GUI method for same from dhcp management console)

You can use netsh commands to back up the database; this is useful for backing up the database to a remote location using a script file.

The following command is used to Export and import dhcp database. (DHCP data for all scopes)
Open CMD as admin privilege and type following command.
Syntax:
netsh dhcp server export "c:\YourFolder\YourFile.txt" all

Netsh utility for DHCP backup restore

Example:
netsh dhcp server export "c:\Database\DhcpFile.txt" all
To restore the DHCP database, use the following command:
Syntax:
netsh dhcp server import "c:\YourFolder\YourFile.txt" all

Example:
netsh dhcp server import "c:\Database\DhcpFile.txt" all
Nice you finished it.
Note: If you are using this command on same server for testing purpose, kindly remove scopes from dhcp console before restoring otherwise you might get error like existing database.

No comments:

Post a Comment