OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: moware on April 17, 2023, 04:15:57 PM

Title: Upgrade vom 22.10 (business) to 23.1 (community)
Post by: moware on April 17, 2023, 04:15:57 PM
I already have a running opnsense firewall, and I want to use a second device as cold standby. I bought one of the Deciso devices, and they arrive pre-installed with opnsense business (22.10). For compatibility reasons (I want both devices to have exactly the same configuration), I also want this device to run the community edition (just like the main device).

So far, I did the following:


Fetching change log information, please wait... fetch: https://pkg.opnsense.org/FreeBSD:13:amd64/22.10/sets/changelog.txz: Not Found

This will automatically fetch all available updates and apply them.

Usage: pkg version [-IPR] [-hoqvU] [-l limchar] [-L limchar] [-Cegix pattern]
                    [-r reponame] [-O origin|-n pkgname] [index]
        pkg version -t <version1> <version2>
        pkg version -T <pkgname> <pattern>

For more information see 'pkg help version'.
This update requires a reboot.

Proceed with this action? [y/N]:


Indeed, https://pkg.opnsense.org/FreeBSD:13:amd64/22.10/sets/changelog.txz does not exist.

How do I tell my device (from the CLI) to upgrade to the latest community edition?
Title: Re: Upgrade vom 22.10 (business) to 23.1 (community)
Post by: franco on April 17, 2023, 06:04:12 PM
I'm not entirely sure we are looking at the full picture. The business edition 22.10 now has the 23.1 config of the other device? It should move over to opnsense package with a full transition but seeing it not do that has me wondering about what state config.xml might be in. Can you grep the following for me?

# grep "<type>" /conf/config.xml

If it says "opnsense-business" you need to edit /conf/config.xml and remove that whole line.


Cheers,
Franco
Title: Re: Upgrade vom 22.10 (business) to 23.1 (community)
Post by: moware on April 18, 2023, 10:54:56 AM
Quote from: franco on April 17, 2023, 06:04:12 PM
The business edition 22.10 now has the 23.1 config of the other device?

Yes, that should be the case. The CLI shows the network configuration from the main device, so I have to assume that the import was successful.

I'll check for <type> on Friday, when I'm back at the office, and report back. Thanks!
Title: Re: Upgrade vom 22.10 (business) to 23.1 (community)
Post by: moware on April 24, 2023, 07:28:45 PM
OK, here we go: config.xml did *not* have opnsense-business anywhere.

I tried the upgrade process again, and, this time, I was bold and chose "y" despite the scary sounding error message about pkg being called with the wrong parameters and... it worked. First it downgraded to 22.7.11 and repeating the upgrade process eventually upgraded it to 23.1.6. :-)




Naturally, I wanted to find out *why* that scary pkg message turned up, and the root cause seems to be the following code in scripts/firmware/reboot.sh:

if [ -n "${LQUERY}" -a -n "${RQUERY}" -a \
    "$(${PKG} version -t ${LQUERY} ${RQUERY})" = "<" ]; then
echo ${RQUERY%%_*}
fi


Apparently test's -a doesn't short-circuit, so, when RQUERY is empty (due to failing to fetch a server-side file?), pkg version still displays error output. My sh skills are a bit rusty, but I see a few ways to fix that:

Best regards and thanks for all the great work on opnsense
Heinzi
Title: Re: Upgrade vom 22.10 (business) to 23.1 (community)
Post by: franco on April 25, 2023, 08:02:27 AM
Nice catch, thank you. I've added https://github.com/opnsense/core/commit/780bb10f2


Cheers,
Franco