Quickly migrate DHCP Scope to another server–Server2012

Posted by

A very quick and simple way to do a DHCP migration from 2008 to Server 2012 is to use PowerShell.

You may not want to do a full server migration in one go, so this PowerShell command allows you to migrate each scope, with it’s reservations and any options to a new server.

1. Reduce your lease time to around 4 hours on your existing server. This will allow you to easily swap your scopes over without causing conflicts out of hours.

2. Setup you new Server 2012 server and install the DHCP role

3. From the 2012 server launch an administrative PowerShell window and use the following command

Get-DhcpServerv4Scope -ScopeId xxx.xxx.xxx.xxx –ComputerName original-dhcp-server-name | add-dhcpserverv4scope -ComputerName new-dhcp-server-name

4. You should now (after a refresh) see the scope copied into the new DHCP console on the new server. It will be enabled so you may want to de-activate the scope at this point.

5. When you are ready to do the swap over (make sure your clients have picked up the new reduced lease time before you proceed), out of hours you can disable your existing scope and enable your new one.

NB: it might be wise to enable conflict detection on the IPV4 properties Advanced tab to help prevent any duplicate IP addresses – you can disable this once you have completed your migration

image