[dual-firmware] A question about Backup

In view of an upcoming firmware upgrade I ask: Is it possible to backup all the additional applications installed on openwrt with their settings and then be able to restore them once they perform the upgrade? This need derives from the fact that those who have a router with double firmware, in order not to lose the original firmware, cannot / must do sysupgrade so every time there is an update, it must be done from the desk with the original firmware. I understand that the backup function does not fully include all of this. It's correct? Otherwise what does the backup include?

See https://openwrt.org/docs/guide-user/additional-software/opkg#extras

1 Like

The backup includes all configuration files /etc/config but it doesn't include the packages you installed (for reasons).
Check out the "Back up user-installed packages" on the sysupgrade document.

1 Like

if you are using snapshot/master ... i'd be very careful with this technique...

the technical equivalent is to use imagebuilder... with your backup placed in './files/sysupgrade.tgz'...


No snapshot. Only Release because i use a EA8300 on a MR8300 on wait a official release (i hope it!).

I use WRT1900AC v.1 ad EA8300 in my network. I just have an opkg command that I run after each upgrade that reinstalls all the packages I use, then I restore the settings. Works very well, and is quick.

and which?

I'm currently on 19.07.5

OK.I don't understand how the new firmware knows your package you need - Are included in the command? Wich command you mean?

The firmware doesn't know what I want, but I do. So I run:

opkg update

Then I install all the packages I need with one command:

opkg install luci-app-advanced-reboot luci-app-ddns luci-app-nlbwmon luci-app-watchcat ipset nano openssh-sftp-server speedtest-netperf wget

This will install all the packages and all dependencies that are necessary. Then I go into the OpenWRT admin at and restore my settings that I save before installing the updated firmware.


The answer from @jc1685 is the easiest way to do this but I also found another way in case you forgot to keep track of all the packages you have installed with opkg install ...

It's explained in the Upgrading OpenWrt firmware wiki in the "Back up user-installed packages" section.

Basically you copy the opkgscript.sh to /etc/config and run it like:
# sh opkgscript -v write
It makes a file with a list of all your installed packages in /etc/config/opkg.installed

Then you save that somewhere and if you later need to do a clean install you can copy it back after the install and run:
# sh opkgscript -uv install

And it installs all packages from that list that are not already installed.

If you do a firmware upgrade then files in /etc/config are not over-written so you could just leave that opkg.installed file where it is.

After that you would restore a settings backup (if you made one!) using LuCI Interface or from the command line like this:
# sysupgrade -r /path/to/settingsbackup.tar.gz


1 Like