I am searching for an easy way to update between mayor Openwrt version and a sysupgrade with keep settings is not advised. Or in my situation migrating my main router to a new router different type and keeping your settings.
For this reason, I would like to create and UCI-defaults script that I can add by firmware selector under the UCI-defaults settings and including in my image.
Is there a way to determine the UCI-defaults from your existing install and use that for a new installation?
This will create by uci show a very large script with all your settings. This is way more as my current changes on my router. Is there also a script or uci show command that you can run to give only your changes your you can use for an easy migrate?
Next step would then also copy your opkg installed package list and compare to a blank install as mentioned here
In conclusion what are the recommended ways to update Openwrt migrate to different router and keep your settings?
The recommended approach is not to do this[*]. OpenWrt's configuration does include target-, model- and device specific entries, there is no 3-step guide to profit here.
I have spend so many days in getting a working install with VLANs, PPPoe working, WiFi fast roaming, guest wifi, ad-blocker, luci certificates, DNS over HTTPS, etc. And would like to prevent again many days of tweaking. It's my main router so not many time is allowed from the family without a working main router.
No suggestions to at least make an uci-default of your working basic setup?
I run mine as a VM. Back-ups are easy and anytime I need to roll-back a change I can with confidence.
If the upgrade works, I just back that instance up.
You can clone VMs easy so your settings are all still in there.
This is a great script to use for Proxmox if your interested in checking it out.
Do a backup of your current settings, install both routers with default configs only, then compare the default settings to understand device specific parts. Then merge those manually. I used to do that a while back.
Replicate the settings manually on your new device, before you make that the primary router.
Some things can be moved over safely, but we're talking individual files, and making the assumption that the other parts of the configs are properly replicated. For example, you can move over the DHCP and firewall files, and you can probably also move over your adblocker and certificates files. But do not attempt to copy/restore the network and wireless files in particular.
If you ask me the best long term solution has been to make a bash script mostly with uci code that I manually run after syst upgrade to rewrite the config files and cron file.
It is a big one-time work to do (it is about 1400lines of code, but is has evolved over time) but once done it handles all setup variants I can choose between and all router variants I have.
After your feedback here, I decide to start over and copy my settings manual over in LUCI by using the main router as example. By doing this I copy the UCI commands as shown by LUCI interface and build my own uci-defaults script this way.