question

EdDias-7026 avatar image
0 Votes"
EdDias-7026 asked EdDias-7026 commented

Migrate DHCP from server 2012 R2 to Server 2019

I need to migrate DHCP from a server running 2012 R2 to Server 2019. I see there is a new migration tool however I wish the new server to have the same IP address as the old server. Does anyone have the steps or a guide for this?

Thanks.

windows-server-2019windows-server-2012windows-dhcp-dnswindows-server-migration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GloriaGu-MSFT avatar image
3 Votes"
GloriaGu-MSFT answered MichaelR-0135 commented

@EdDias-7026 Hi,

Thank you for posting in Q&A!

I've done tests in my own environment with server 2012R2 and server2019, it can be done by PowerShell command, please follow these steps:

1.Log in with an administrator account to the Windows Server 2012 R2 system.

2.Open Powershell and then type in the following command:

Export-DhcpServer -File C:\DHCPdata.xml -Leases -Force -ComputerName old.network.local –Verbose

43870-15.png


3.Copy the file C:\DHCPdata.xml the Windows Server 2019 system.

4.Install and configure the DHCP role on Server 2019

5.Start the DHCP service.

6.Type in the following command on Powershell to import the DHCP Data.

Import-DhcpServer -File C:\DHCPdata.xml -BackupPath C:\DHCP\ -Leases -ScopeOverwrite -Force -ComputerName new.network.local –Verbose

43789-16.png

7.Restart the DHCP service.
Verify your DHCP scope, IP leases, reservations etc and they should match with DHCP Server 2012 R2.

43883-17.png


Hope you have a nice day : )
Gloria
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
https://docs.microsoft.com/en-us/answers/articles/67444/email-notifications.html



15.png (44.6 KiB)
16.png (27.7 KiB)
17.png (13.2 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I was looking for this.

Thank you.

0 Votes 0 ·

You're welcome~

0 Votes 0 ·

Dude this was exactly what I needed, This was amazing. Thank you for taking the time to post this information.

0 Votes 0 ·
DSPatrick avatar image
0 Votes"
DSPatrick answered DSPatrick edited
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EdDias-7026 avatar image
0 Votes"
EdDias-7026 answered DSPatrick commented

Thanks but your first link is dead.
Edit: the ending ) isn't included in the link so I added it manually.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EdDias-7026 avatar image
0 Votes"
EdDias-7026 answered

Just reading through that guide. Isn't that for older server versions? Rather than the newer Export-DhcpServer powershell command?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered

Yes, you can certainly also do via PowerShell
https://docs.microsoft.com/en-us/powershell/module/dhcpserver/export-dhcpserver?view=win10-ps
https://docs.microsoft.com/en-us/powershell/module/dhcpserver/import-dhcpserver?view=win10-ps

but probably should unauthorize old, do the addressing changes, then authorize new one.



--please don't forget to Accept as answer if the reply is helpful--







5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EdDias-7026 avatar image
0 Votes"
EdDias-7026 answered GloriaGu-MSFT commented

Thanks, for changing the IP address after migration , is it just a simple case of changing it in the normal via the connection properties?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, that's true.

0 Votes 0 ·
EdDias-7026 avatar image
0 Votes"
EdDias-7026 answered EdDias-7026 commented

So steps would be.

  • run export powershell on old server. Deauthorize it in DHCP

  • Change IP of old server

  • Install DHCP server role on new server.

  • CHange ip to old server ip

  • Run import powershell

  • Auth new server with new ip (of old server)

  • Test!

  • Relax


· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, waiting for your good news of test! Merry Christmas~

1 Vote 1 ·

Well I exported and imported and the only red that appeared during the import was:

VERBOSE: Importing option definitions on server...
Import-DhcpServer : Failed to add option definition 249 on DHCP server server.name.local. : The specified
option already exists. (20009)
At line:1 char:1
+ Import-DhcpServer -file "c:\export\dhcpdata.xml" -backuppath "c:\back ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (249:root/Microsoft/...ptionDefinition) [Import-DhcpServer], CimExceptio
n
+ FullyQualifiedErrorId : DHCP 20009,Import-DhcpServer



I've authorised the new server and tested and it seems to be dishing out IP addresses.

thanks






0 Votes 0 ·

EdDias did you just export and import using powershell or you have used Windows Server Migration tool?

0 Votes 0 ·
Show more comments