Import DHCP leases

I have exported a list of leases from Router A and I need to import this list into Router B. What is the easiest way to do this?

Thank you

I am assuming you are talking about static leases.

If it’s Mikrotik to Mikrotik:
you should be able to export from /ip/dhcp-server/lease and then paste straight away in terminal on new router.

Foreign router/server to Mikrotik:
How I did it last year (did it as part of decommissioning a Windows DHCP server for an RB5009):

  • add one entry manually
  • export and see how it is constructed
  • Excel, bit of string functions and recreate the script line by line so you got one line per lease
  • copy-paste in terminal
  • done.

Yes; MK to MK.

I made them all static for simplicity. I exported to txt file, but I can copy and paste. Where do I paste? \ip\dhcp-server\lease ???

The same place they were exported from … /ip/dhcp-server/lease/ seems a sensible place.

Got it; I didn’t realize it exported as a command.

Sincerely,

Captain Observant

It did work, by the way. Thank you for the help.