Backup/restore procedure on router change

Hi, I plan on changing from a Linksys WRT1900acs to mikrotik hap ac2 router.
The Linksys router is running this build from user david502:
OpenWrt SNAPSHOT r10899-1c0290c5cc / LuCI Master (git-19.241.65047-dffe9ca)

Now I'd like to know if my backup/restore procedure could also work when switching devices:
This is my current backup script:


/bin/opkg update
/bin/opkg list-installed > /etc/config/installed.packages
/sbin/sysupgrade -v --create-backup /mnt/backups/router/backup-$(cat /proc/sys/kernel/hostname)-$(date +%F).tgz


  • install latest Openwrt on new device

  • restore installed packages:

root@homesrv:~# opkg update
root@homesrv:~# opkg install \
   $(cut -f 1 -d ' ' < /etc/config/installed.packages)
  • enable and set up ssh

  • restore old router backup via webif

Can this work or do I have to copy over all config files by hand?

there's a differance between config, and packages.

the steps above handle only packages, if you want to migrate the config, you'll need to export/backup it from the WRT1900 - the functionality's in the firmware screen.

not sure how well it works between different devices/hw, there will be device specific stuff in that export/backup. i think the feature's intended for backing up between releases, or when doing a


Nope, this line in my script does the config backup:
/sbin/sysupgrade -v --create-backup /mnt/backups/router/backup-$(cat /proc/sys/kernel/hostname)-$(date +%F).tgz

Yeah, I'm also unsure if restoring the backup on a different device would work. That's my main question here.

It won't work because device interface names are probably different.


Thx. You mean eth0 , eth8 , radio0 , wlan19 and such right?
Can you think of other stuff that's different?
I want to try to manually change the old config files and copy them over. Should work, right?

Your package restore approach will fail, because there are different hardware drivers etc., and they are also packages. At least you will install unnecessary packages from the old router...

E.g. wifi drivers: it makes no sense to install the mwlwifi related packages in a different router, although the packages are on the list of installed packages.

You could use them as models / recipes, but you should not try to re-use /etc/config/{system,network,wireless}. Firewall is more compatible regarding zones, but you may have major difference in interface names especially if you move from a DSA device (like mvebu routers) to a non-DSA (like ipq40xx), or vice versa.

I now noticed that your previous version is really ancient, from 2019??? Disregard the talk about DSA, as mvebu did not yet have DSA in those times. But the ancient stuff means that more has changed in the three years.

1 Like

I changed my reply because I wrote it too quickly, you should not overwrite the new files with the old ones;

What I do (using WinSCP) because I maintain 2 different routers with the "same" config (GL-MV1000 and RB750Gr3). I edit the new default conf files and put in them just what is necessary from the other router's conf files.

1 Like


Yeah... :face_with_open_eyes_and_hand_over_mouth: that can be accurate.
Well, I'm gonna just try and use my old routers backup as "templates" to edit new files and install new, needed packages by hand.

Yeah, I also used winscp and notepad++'s compare plugin to compare new and old config files. I noticed in the network conf that now there are devices, on my old conf everything was in interface.

But it was self explanatory and easy to get everything up and running. Thx @DeepAnger and @hnyman :+1:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.