Asked myself about the full backup and ready to reply - this is how I duplicate the devices (did it already 3 times with 3 different devices - total time to restore the device is about 15 minutes).
Why? Because I simply want to swap the dead device with a new one and dont waste any time to set it up and such - I also want to make sure that it will behave exactly as the old one.
Since I keep AdGuardHome, BanIP, nlbmon, syslog and rrd (plugin used by collectd) on a MicroSD in case of AXT1800 or an external USB flash drive in case of other devices the procedure is a bit complicated but it guaranties that I always have my data stored outside of the device which can fail any time.
Original device that will die in future:
1: attach external USB flash, it will be automatically mounted in /tmp/mountd/diskX_part1 - will it be disk1 or disk2 is big mystery to me, see below;
2: set up AdGuardHome, BanIP, nlbmon, syslog and rrd to be stored on the external USB disk (if you care otherwise dont);
3: copy to the external USB disk the firmware used by your current device;
4: run the script /bin/list_my_installed_packages.sh - you have to find it on the forum and put it in there in advance;
5: copy /root/backup/ dir (created by list_my_installed_packages.sh) to the external USB disk;
6: copy /etc directory to the external USB disk;
7: DO STEPS 4-6 every time when the settings have been changed/packages were installed by simply updating your existing directories on the external USB disk;
if everything works just forget about it.
The device stopped working - get a new device first.
-
move the external USB disk to the new device - CHANCES ARE THAT IT WILL BE MOUNTED NOW as a different disk - no problem, see below;
-
if you care about original domain name (Gl calls it hostname) (XXXXX.glddns.com) of your new device (every router updates its domain name by using a unique username and password) then enable DDNS in the GL GUI first and after that copy /etc/config/ddns to the external drive (you may need it later). I dont care about new DDNS because I want the new device use the same old DDNS - there is a reason for that;
-
if you care about mac addresses of the new device (to use them later) - copy the original /etc dir to the external USB disk - you will find them later - I dont because I want the new device to be a copy of the old device;
3)reinstall on the new device all packages using the list of packages generated on the old device and stored on your external USB disk;
4)copy /etc dir from your external USB disk to your device basically overwriting the content of the original /etc dir.
- modify /usr/bin/@AdGuardHome symlink to point to external USB disk if you keep AdGuardHome on the external USB disk;
Pay attention to one moment: was the external USB disk mounted exactly as it was mounted on the old device (i.e. "disk1_part1 vs disk1_part1" and not "disk2_part1 vs disk1_part1"?
If not then search for "disk1_part1" in /etc and replace with with the correct string (for example disk1_part1), otherwise do nothing
REBOOT - your new device behaves yourself exactly as the old, dead one.
KEEP the data on the external USB disk updated.
--
Why I did not modify the Openwrt backup and did not use the backup instead? Because last time I knew for sure that I was making regular backups. But when the device died I could not find any recent backups - dont ask how it could happened.
QUESTION for GL.iNet Staff: if there any logic in how disk numbers are assigned to attached USB disks? If I attach FAT32 formatted disk it will become disk2_part1. if I format it as ext4 it will become disk1_part1. It would be nice to make sure that disk labels will be identical on both devices - then no edit of symliks would be required.
Thanks.