Monday, May 12, 2014

Moving DHCP to a new server

Today I moved DHCP from one server to another.  This, in itself, is not a remarkable thing.  What is remarkable is that it worked the first time I tried it.  No jumping back and forth, no database copying, no duplicate leases. Just worked.  Wow.

This was from Windows 8.1 workstation managing Windows Server 2008R2 (old) and Windows Server 2012 R2 (new).

  1. Install DHCP on the new box, but do not configure or authorize it.
  2. Open a powershell command prompt
  3. Use export-DHCPServer to dump the data out of the old server.
    Export-DhcpServer –ComputerName dc1.fabrikam.com -File C:\export.xml -Leases -verbose
  4. Use import-DHCPServer to load it into the new server.
    Import-DhcpServer –ComputerName dc2.fabrikam.com -File C:\export.xml -Leases -BackupPath C:\dhcpbackup\ -Verbose
  5. Open the DHCP mmc and add the old and new dhcp servers to the console.
  6. Authorize the new DHCP server.  
  7. Restart DHCP on the new server so you don't have to wait for it to notice.
  8. De-Authorize the old DHCP server.
It worked.  I shouldn't be stunned at this, but this used to be a huge PITA.  One Billion points to Microsoft for making this awesome.

We now return you to your regularly scheduled "Looking at Lolcats on the Internet."

No comments: