Migrate DHCP leases

Applicable from Windows 2008 up to 2012 R2
 
When you want to migrate DHCP from one server to another, and you want to keep the DHCP scope as is; you will always have the challenge with current DHCP Leases that already are given to clients.
 
To overcome this; we can easily migrate the leases from the older server to the new one.
 
Firstly prepare your NEW server with the DHCP feature; also be sure that this server is 2012 or up and it's ready to serve it's role.
After that you must run this in Power Shell; I always prefer Power Shell ISE for this, because you can see the code an easily adjust where needed. Also don't forget to run Power Shell in Admin Mode.
 
Export-DhcpServer –ComputerName oldserver.domain.extension -Leases -File %userprofile%\Desktop\dhcpexp.xml -verbose
Import-Dhcpserver –ComputerName newserver.domain.extension -Leases -File %userprofile%\Desktop\dhcpexp.xml -BackupPath C:\windows\temp\ -verbose

After that, just disable the DHCP feature on your old server. Also be sure that any IP helpers (if applicable) are updated to point to your new server.
 
Regards,
David