This will tell you how to export or import a copy of a DHCP database. This is handy for backups or moving to a new server.
![]()
Learning has never been so easy!
Applies To: Windows Server 2003, Windows Server 2008, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8. Imports and exports data from Active Directory Domain Services (AD DS) using files that store data in the comma-separated value (CSV) format. Basic export. The basic export will dump all records from Active Directory into a CSV file without any filtering of results. By default CSVDE will bind to AD using the credentials of the users currently logged on-to specify different credentials use the -a flag (-a UserDN Password.).
15 Steps totalStep 1: Login to the DHCP server with appropriate credentials
Click start - run - type cmd and press enter
Step 2: In the command console
Type:
netsh dhcp server export c:dhcp.txt all
Then press enter. You can change the path and filename to suit your needs.
Step 3: You should see confirmation after a short bit
The amount of time to backup your database will be dependent upon the size. You should get a confirmation that it was completed successfully.
Step 4: Login to your target server
Login with the appropriate credentials on your target server for importing. If you haven't installed the DHCP role yet open the server manager console and click on Add Roles.
Step 5: click the DHCP Server box to add the role
then click Next, then Next again
Step 6: Make sure the correct IP is selected for binding
then click Next
Step 7: Configure DNS
Set parent domain, Primary and Secondary DNS server IPs and click Next (in this instance the primary is the loopback for the DC that is being used as an example)
Step 8: If WINS is in use...
click the radio button for 'WINS is required...' and configure your Primary and Secondary server IPs then click Next, if you don't use WINS, leave the default setting and click Next
Step 9: Since we are importing a database, just click Next on this screenStep 10: ***Usually you can disable DHCPv6 stateless mode
If you aren't sure you I can't tell you if you need it or not so either accept the default or change it and click Next
Step 11: You should get a confirmation message saying the install succeeded.
****I wouldn't import the database onto the new server until you have gone to your old DHCP server and either disabled the DHCP Server service, deactivated the scopes or Unauthorized it.****
Step 12: Open a command prompt on the new server![]() Step 13: In the command console
type:
netsh dhcp server import c:dhcp.txt all
Then press enter. You can change the path and filename to whatever you are using. This HOWTO skips the step of copying the file you exported to the root of C: on the new server.
Step 14: You should get a message saying the command completed successfullyStep 15: Sometimes you will get this error
“Error while importing option “6.” “This option conflicts with the existing option “” An Internal Error Occurred.”
when you add the DHCP server role it puts the following entries in Server Options
006 DNS Server 015 DNS Domain Name
Just delete those entries and run the import again.
Now Spiceheads around the globe can export and import DHCP from the CLI in Windows. Enjoy!!!
7 Comments
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |