Migrating config from 19.07 to 21.02 (swconfig to DSA)

Download the backup-- it is a tar archive so Linux can handle it directly as well as archive / zip programs on Windows.

The files inside particularly in /etc/config are text files with a basic structure. All of the differences between DSA and swconfig will be in /etc/config/network.

1 Like

I will have a closer look at all the individual files tomorrow, when I have opportunity to attempt this. I will load them all up in Notepad++ and use them as a reference to reconfigure it, trusting that everything I did change at least will be recorded in them.

Maybe it is best to start over from scratch and simply recreate your wifi settings and basic network config. Then add things as you need from there.

2 Likes

An unofficial but tested sysupgrade method for 19.07 to 21.02 is renaming /etc/config/network and /etc/config/system prior to uploading a sysupgrade image, then forcing it. You'll get a scary warning still, but providing these files are named something like /etc/config/network.old and /etc/config/system.old, the sysupgrade process will work fine as they'll just get regenerated with fresh valid configuration files.

As you are aware there is no choice but to wipe your network configuration due to the switch management under DSA, if you don't wipe your old network config, you'll semi brick your router (well at least one boot partition, given the dual flash on the WRT3200ACM).

This somewhat crude method will allow you to at least keep most package files and configurations intact outside of network/DSA, although some packages i.e. DDNS, may have changed since 21.02, so you may need to do some reconfiguring i.e. using old/invalid configuration variables. For the most part though, most packages should just run with the 19.07 configuration in place, but your mileage may vary subject to what packages you have.

I found this way suited my upgrade process due to a lot of additional packages. I used imagebuilder to generate a sysupgrade image with all my packages installed and it was also handy to use my /etc/config/network.old to copy non DSA specific settings for interfaces. Using imagebuilder with packages installed from 19.07 is however likely to yield issues when trying to generate an image due to different packages or packages that don't exist in 21.02, so I needed to do some manual handling there to get an image to build.

Example: wireguard as a package is no longer present in 21.02, being part of the kernel itself but was installed under 19.07, this package would need to be excluded from image builder for 21.02.

As advised, a full tar backup is still a very good idea, in the event a sysupgrade goes wrong or you need to revert back to 19.07. Fortunately, with dual flash, one of your partitions will have your previous 19.07.x build on which you'll be able to boot to, but best to cover all areas.

Wireguard most certainly exists as a package in 21.02

Summary
root@OpenWrt:~# opkg list | grep wireguard

kmod-wireguard - 5.4.179-1 - WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPSec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. It uses UDP.

luci-app-wireguard - git-20.244.42172-21563a2 - WireGuard Status

luci-i18n-wireguard-ar - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - العربية (Arabic)

luci-i18n-wireguard-bg - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - български (Bulgarian)

luci-i18n-wireguard-bn - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - বাংলা (Bengali)

luci-i18n-wireguard-ca - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Català (Catalan)

luci-i18n-wireguard-cs - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Čeština (Czech)

luci-i18n-wireguard-da - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Dansk (Danish)

luci-i18n-wireguard-de - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Deutsch (German)

luci-i18n-wireguard-el - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Ελληνικά (Greek)

luci-i18n-wireguard-en - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - English

luci-i18n-wireguard-es - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Español (Spanish)

luci-i18n-wireguard-fi - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Suomi (Finnish)

luci-i18n-wireguard-fr - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Français (French)

luci-i18n-wireguard-he - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - עִבְרִית (Hebrew)

luci-i18n-wireguard-hi - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - हिंदी (Hindi)

luci-i18n-wireguard-hu - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Magyar (Hungarian)

luci-i18n-wireguard-it - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Italiano (Italian)

luci-i18n-wireguard-ja - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - 日本語 (Japanese)

luci-i18n-wireguard-ko - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - 한국어 (Korean)

luci-i18n-wireguard-mr - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Marāṭhī (Marathi)

luci-i18n-wireguard-ms - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Bahasa Melayu (Malay)

luci-i18n-wireguard-no - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Norsk (Norwegian)

luci-i18n-wireguard-pl - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Polski (Polish)

luci-i18n-wireguard-pt - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Português (Portuguese)

luci-i18n-wireguard-pt-br - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Português do Brasil (Brazilian Portuguese)

luci-i18n-wireguard-ro - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Română (Romanian)

luci-i18n-wireguard-ru - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Русский (Russian)

luci-i18n-wireguard-sk - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Slovenčina (Slovak)

luci-i18n-wireguard-sv - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Svenska (Swedish)

luci-i18n-wireguard-tr - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Türkçe (Turkish)

luci-i18n-wireguard-uk - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Українська (Ukrainian)

luci-i18n-wireguard-vi - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - Tiếng Việt (Vietnamese)

luci-i18n-wireguard-zh-cn - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - 简体中文 (Chinese Simplified)

luci-i18n-wireguard-zh-tw - git-22.072.58822-9be6f29 - Translation for luci-app-wireguard - 繁體中文 (Chinese Traditional)

luci-proto-wireguard - git-21.243.21928-71fe35c - Support for WireGuard VPN

wireguard-tools - 1.0.20210223-2 - WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPSec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. It uses UDP. This package provides the userspace control program for WireGuard, `wg(8)`, a netifd protocol helper, and a re-resolve watchdog script.

I use a diff program to compare configs, and use that as a guide.

Example -

I do the same for packages.

WG changed from being a package to a kmod hereabouts.

1 Like

Fair enough :-). Valid distinction, for sure.

As @anomeome clarified for me, I was referring to the fact the package itself named wireguard doesn't exist in 21.02, but did in 19.07 so if you were to try and use imagebuilder in 21.02 with packages installed from 19.07, that's one of the gotchas, but it's not exclusive to Wireguard, just an example I know of. Wireguard itself of course exists in 21.02, sorry if I wasn't being clear there.

1 Like

Shortly I'm going to try this shortcut procedure, since it seems applicable to my simplistic use of the router. Thank you for mentioning it. I can still use WinMerge to compare the before and after copies of the network and system files. I've forgotten how the dual-ROM feature works, but nevertheless I have a 19.07 backup, so if it were necessary I could clean-install 21.02, make a backup of that, compare all the files and not just network and system, and then edit from there.

power switch method, you can also install app or use CLI.

This will no doubt reveal the depth of my ignorance, but how exactly do I rename these files? For the first time I enabled SSH on the router, used Kitty to connect to it via BusyBox and get a command prompt... but now I'm stuck. I recall precious little about using Linux via a command line; the last time I did that might have been around '93 with Slackware! I tried to use cd to switch to the /etc directory, but was told it didn't exist. I then tried ls to list everything, but the command returned nothing. I then guessed and tried ls -all, and while that provoked a response it was nothing more than "." and "..", so it's seeing no files or directories.

What am I doing wrong?

Addendum: Okay, apparently I wasn't at the root! cd / got me to the root, and then ls had some things to report. Onward....

cd /etc/config
mv network networkBAK
mv system systemnnBAK

do not forget this is happening on the image from which you are flashing away from

cd /etc/config
mv network network.old
mv system system.old

Ha @anomeome beat me to it.

Already done! I managed to reeducate myself....

What does that mean, and how does it affect what I'm doing? Do you mean to say that my commands here are not acting upon the ROM image that will be upgraded, or that the upgrade ROM will actually be written to the non-active Flash, leaving these renamed files behind in the Flash that will become non-active? I've forgotten how the dual-Flash feature works.

The image that you flash will have the change, but since those files do not exist the startup system will generate default OOTB configs. But should you go back to the previous image as per above, you will again have OOTB defaults so:

cd /etc/config
mv networkBAK network
mv systemBAK system

to actually get back from whence you came will be required; or restore that backup that you generated.

Yes, given what you said I figured at the least I would have to rename the 19.07.9 files to restore them, but given that it will be swapped to the non-active Flash I won't be able to do that preemptively, right? I would have to again boot to 19.07.9 in the other Flash in order to have access to its filesystem and be able to rename them, yes?

Also, restoring a backup writes it to the non-active Flash, I presume?

Can be done with obvious risks, but if you have serial or are sure of your WIFI... long and short, don't bother, might bork your good'n.

Backup / restore is relative to your current running version.

There is another way if you have the facility. Make no change to your current system, extract the backup that you took, rename the relevant file in the backup, tar things back up, and restore the backup to your newly flashed version.

Thank you to everyone for the replies and advice. I believe that I have things sorted, but not without a few confusing hiccups having to do with inability to connect at several points.

I'm by no means an expert interpreter, but comparing the 19.07.9 files to the default ones created for the 22.02.2 forced upgrade, it doesn't appear to my eyes that there is anything to carry over or merge from 19.07.9. I wound up having to mess with my NAS's connectivity at the same time. I am still confused about the existence of this mysterious "radio 2" WiFi radio and whether it can be constructively used for anything; it's disabled at the moment with an SSID of "OpenWRT", which I assume was auto-assigned to it.