Skip to content
Contents
GuidesOpenWrt

Before upgrading OpenWrt, verify your AdGuard Home rules, DoH settings and traffic history backups

Compare sysupgrade candidates with the archive, save application data and usage databases separately, and repeat the same DNS checks after the upgrade.

The LuCI option to retain settings does not guarantee the return of your filtering YAML file, traffic database or application binaries. Choose three things you want back: a custom rule in use, the DoH upstream setting and one device's usage for last month. For each, record the actual file, its storage location and a test you can repeat.

Locate the active files before checking the backup

Find the AdGuard Home configuration file and working directory in the service definition or process arguments. Record custom rules, subscription URLs, local lists and rewrites. For https-dns-proxy, save its UCI configuration and the dnsmasq forwarding settings. With nlbwmon, check its configuration and database_directory. History in tmpfs can disappear on reboot. Flush available history to its database using the installed version's command, such as nlbw -c commit where supported, then back up the database directory.

On the router, list candidates with sysupgrade -l, make a configuration archive with sysupgrade -b /tmp/router-backup.tar.gz, and check its members with tar -tzf /tmp/router-backup.tar.gz. If a small required persistent file is missing, add its actual path to /etc/sysupgrade.conf and regenerate the archive. Keep independent, protected copies of large databases, external disk data and application directories containing keys. For files still being written, use a maintenance window, flush pending writes and stop the relevant service briefly or use its consistent backup method.

On OpenWrt 25.12.6 the candidate list and the archive contain four UCI files. Two other exact paths are absent.

The lab archive contains etc/config/adguardhome and lacks the exact path etc/adguardhome.yaml. This establishes archive membership only. Inspect startup arguments to find out whether the application uses a different file, the file is missing or the application is not installed. Copy the backup from /tmp to a computer, verify the copy and list its members before upgrading.

After restoration test a rule, the upstream and historical usage

For a supported upgrade on the same model, check package availability and keep the old version details, installed package list, image and recovery instructions. After booting, verify external mounts and directory permissions before starting dependent services. Query the router for an allowed and a blocked name and inspect the matching rule. Send an uncached query and check the actual dnsmasq and encrypted proxy path. Compare the saved month and device in the traffic history, then make a known transfer and check for new counters.

If DNS fails, restore the known working forwarding chain from a wired management session. If only history is missing, stop the service that could write into an empty directory, check the mount and restore the required database from the copy. When moving between different models or storage layouts, import only the settings you need. What does an OpenWrt configuration backup restore?

Compare the candidate list with the files inside the backup

Connect to the router over SSH. Check temporary space with df -h /tmp and replace the example paths with your own. The screenshot is from an isolated OpenWrt 25.12.6 VM.

ubus call system board | jsonfilter -e '@.release.description'
umask 077
work=$(mktemp -d /tmp/backup-check.XXXXXX) && cd "$work" || exit 1
sysupgrade -l > wanted || exit 1
grep -E '^/?etc/config/(dhcp|firewall|adguardhome|https-dns-proxy)$' wanted
sysupgrade -b "$PWD/router.tar.gz" || exit 1
tar -tzf router.tar.gz > members || exit 1
grep -E 'etc/config/(dhcp|firewall|adguardhome|https-dns-proxy)$' members
grep -Fx etc/adguardhome.yaml members || echo 'This exact YAML path is absent'
grep -Fx etc/config/nlbwmon members || echo 'This exact nlbwmon path is absent'
sha256sum router.tar.gz

OpenWrt 25.12.6 · SSH · sysupgrade

Account for the leading slash when comparing lists. Check the actual filename if an example is absent. Stop on backup or extraction errors. Copy the archive securely to your computer, compare SHA-256 on both ends and list its contents again. Save application data separately before clearing temporary files.

Why are new queries visible but yesterday’s statistics empty?

Before upgrading, pick a completed interval. Record the time zone, retention period and totals. Locate the query log, statistics database and nlbwmon data separately. Pause writes or use a consistent backup supported by your version. Keep one copy untouched by the new release.

After restoring, select the same interval and send a fresh query from a client. If only new data appears, check which dataset you restored, the working directory and expiry settings. If neither appears, confirm the query reaches this resolver, then check logging and write permissions.

If migration fails, test a copy with the matching older version. Mark gaps as missing. Encrypt backups and keep queries and keys private.

Reference

Reference

Check the model, region and hardware revision on the label before selecting firmware.

Explore hardware

Comments