Being a Windows System Administrator, you have to deal with migrating DHCP role to another Server due to various reasons (Hardware/Software end of life, DHCP Server having issue, merging roles, etc.) This can be a simple task, depending on the complexity of your DHCP configuration. You may be able to manually recreate the scopes on the new server if you only have 1 or 2 scopes, but if you have numerous scopes with many reservations, you can better use the export and import configuration feature.
Exporting Configuration
- Open the DHCP console, on the old server.
- right-click on the SERVER, and choose Backup.
- Choose your destination folder, and click ok.
- Verify the file was created in the backup destination you chose.
Using Command Line
Export-DhcpServer -ComputerName “servername.domainname.com” -Leases -File “C:\DHCP\OldDHCPConf.xml” –Verbose
Install DHCP Role on new Server
- On your new server, open Server Manager,
- Choose Add Roles and Features.
- Under the Server Roles page, select DHCP server, and install.
- A reboot should not be required to install the DHCP role.
Import Configuration
From your old server, copy the DHCP backup file to a folder on your new server.
- In the DHCP console on the new server
- Restore the DHCP scope from the file copied.
- Right-click on the server name and select Authorize. (You can Un-authorize old DHCP at this point)
Using Command Line
Import-DhcpServer -Leases –File “C:\OldDHCPConf.xml” -BackupPath “C:\DHCP\Backup” –Verbose
Removing Old Server
Verify that new Server is able to allocate IP Addresses by “ipconfig /renew” on client PC or rebooting workstation. You can also notice new leases in the DHCP console on new Server. You can remove DHCP role from old server after verification.
- In server manager, select Manage in the top right corner.
- Choose Remove Roles and Features.
- Uncheck the DHCP role, and it will be removed from the server. Again, no reboot is required.