Keep data on router after firmware update


I noticed that my MT-6000 router storage is emptied when firmware is upgraded. Is there a safe place where I could keep data when upgrading firmware.

hmm what type of data do you mean you want to preserve?

I need to know a few things to know exactly what you mean.

  1. you just want a backup?, you can enter luci via advanced settings and then on System → Backup / Flash firmware you can make a backup.

  2. if you upgrade and select keep settings you won’t lose the data.

  3. do you want to preserve a script in a backup or some specific files which not include themselves in a backup?, then you can add the location in /etc/sysupgrade.conf now if you make a backup it will be included.

  1. do you want to run code after a upgrade?, then you have /etc/uci-defaults

as you see theres alot of choice and directions :slight_smile:

I run a Swag docker container to reverse proxy AdguardHome DOH.

I just want to keep somewhere the docker-compose.yml to lauch swag and the “data” volume of swag (nginx config, certs…)

ah I see :slight_smile:

I think what you want is include /opt in /etc/sysupgrade.conf.

this way you let OpenWrt know it should include it in the backup mechanism, now I’m not sure if it keeps it also if you upgrade with the keep settings checkbox, I would expect it will be but don’t count me on this yet ! making a backup is very advised :slight_smile:

if your compose file is stored somewhere else it works the same way as adding /opt :slight_smile:

Do you know how to get access and edit this file in your router with ssh or winscp by chance ? :slight_smile:

if not no problem I will help :+1:

Thank you! I’ll try this :slight_smile:

it depends if you want /opt, this is where all docker containers get stored :slight_smile: but alot of these containers also have just config folders exposed somewhere else than in /opt so if the question is more to backup the docker-compose.yml and configuration of said docker container then you might only want to put those in /etc/sysupgrade.conf

I kinda do this with wg-easy on Flint 2 :slight_smile: I just include /root/.wg-easy/ in sysupgrade.conf which then includes it in the backup mechanism so for me preserving the containers is not needed.