For years this has been a tedious task when it came to moving the DHCP server role. In most case this involved manually creating all subnets, IP reservation, Server option etc. and only the DHCP lease database could be copied over. With Windows Server 2012 Microsoft has addressed the issue and in the spirit of their new approach it has implement some cmdlet in PowerShell to do this rather painless. Depending on your environment you could get away with 4 simple steps, provided you have a Windows 2012 Server with the DCHP role installed ready.
- Export ALL setting including DCHP lease from the old Windows 2008 Server
- Shutdown down (and disable automatic startup for the service) the DHCP Server
- Import the setting into the new DHCP server
- Authenticate and start DHCP Server on the Windows 2012 Server
This can take less than two minutes and you are done and ensures you haven’t missed anything either.
PowerShell Export command line (Make sure the directories used exisit):
Export-DhcpServer -ComputerName ServerName.Old -Leases -File c:\export\dchp.xml -verbose
PowerShell Import command line:
Import-DhcpServer -ComputerName ServerName.New -Leases -file c:\export\dchp.xml -BackupPath c:\dhcp\backup\ -Verbose
The above are just same plain examples for the syntax. Feel free to explore the cmdlet, i.e. export only the server setting if you plan to set up a second DHCP server to explore the new replication feature that was introduced with Windows Server 2012.
Last but not least, depending on your environment, you may have to update the servers and/or network equipment with the IP/Name of your new DHCP server. Examples are Cisco’s Wireless LAN controllers and Cisco router/switches using IP helper-address to point clients to a remote DHCP server. It might be worth noting that multiple IP helper-addresses per Interface are possible. It might be advisable to have the Cisco router/switch amended before the actual migration.