Migrate DHCP Role from Server 2008 R2 to Server 2012 R2

After doing a quick google search, it appears you can easily migrate your DHCP server as long as you have both your current DHCP server (running Server 2008 R2) and a new Windows Server 2012 server you are going to designate as a DHCP server.

  1. Login to your new Server 2012 R2 machine with the DHCP role installed
  2. Open up a Powershell shell
    Server 2012 - Powershell
  3. Execute the following command to export the configuration from the Server 2008 R2 DHCP Server
    1. Export-DhcpServer –ComputerName win2k8r2-dhcp.corp.contoso.com -Leases -File c:\users\yourusername\Desktop\dhcpexp.xml -verbose
      Export-DhcpServer Server 2012
  4. Execute the following command to import the configuration into your new Server 2012 R2 DHCP Server; must be an Administrator running this PowerShell command.
    1. Import-DhcpServer –ComputerName win2k12r2.corp.contoso.com -Leases –File C:\users\yourusername\Desktop\dhcpexp.xml -BackupPath C:\users\yourusername\Desktop\backup\ -Verbose

Notes: Credit goes to the following technet article for the powershell commands and a more in-depth explanation: http://blogs.technet.com/b/teamdhcp/archive/2012/09/11/migrating-existing-dhcp-server-deployment-to-windows-server-2012-dhcp-failover.aspx

13 thoughts on “Migrate DHCP Role from Server 2008 R2 to Server 2012 R2

  1. hassan

    Hi,

    I have a windows 2008R2 DHCP server and I have migrated as above to Windows Server 2012R2. I have authorized new dhcp server and unauthorized old server and stopped the role of DHCP in it. However with the new server in place its not leasing any ip to clients. Also I have tried with command prompt to renew my IP and it fails. It seems from IPConfig/all displays still the address of old DHCP server. How can I solve this issue.

    thanks

    Reply
  2. Drew

    Is your network flat, or do you have VLANs in place? If your network has VLANs, you will need to update the DHCP helper records in your network equipment to direct requests to the new server. You could also change the IP address to be the same as the old server.

    Reply
    1. Jack Post author

      Hi Drew,

      If the topology of the network is the same and you are doing an in-place upgrade, you shouldn't be making any changes on your switches.

      Jack

      Reply
  3. hassan

    HI Dew and Jack

    We have VLANS in our network. Network remains the same before and after migration. Could you please elaborate more on how to update DHCP helper records?

    Reply
    1. Jack Post author

      If the network stays the same, you shouldn't have to change your DHCP helper records. The only time you would need to change those records is if your subnets, vlans, or IPs of the servers are changing.

      Hope this helps,
      Jack

      Reply
    1. Jack Post author

      Can you please elaborate what exactly you are trying to achieve? If you aren't changing the configuration on your target server, what is the purpose of the migration?

      Jack

      Reply
      1. Shai

        Thank you for the reply.

        We are migrating dhcp services from our small offices to one HUB site.
        I need to “import” the scope and keep the current setting unchanged.

        Reply
  4. Pingback: Migrate DHCP Role from Server 2008 R2 to Server 2012 R2 | Jack Stromberg | My T.

  5. Greg

    You may want to add "run Powershell as Administrator" to that step. I kept getting an error backing up during the import and running PS as admin fixed it.

    Backup-DhcpServer : Failed to back up the database on server servername to C:\Users\Greg\Desktop\backup.
    At line:1 char:1
    + Backup-DhcpServer -Path $mandatoryParams["Path"] -ComputerName servername 2> ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : PermissionDenied: (servername:root/Microsoft/...P/PS_DhcpServer) [Backup-DhcpServer]
    , CimException
    + FullyQualifiedErrorId : WIN32 5,Backup-DhcpServer

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *