User Tools

Site Tools


other:networking:opnsense:upgrade

Easy Multi-version upgrade of opnSense

WARNING

When I tried to do an upgrade from 24.1 to 24.7, the tool attempted to download from the wrong URL (FreeBSD13: instead of FreeBSD14:) and bricked my router. I ended up reinstalling. However, that is the only time the tool has caused problems for me.

-

I ran into a problem where the master node my fairly complex opnSense High Availability router set up ended up with some problems after about 3 years of running. I had completely undersized the virtual installation (10G) and the log files had filled the disk, causing it to become very unstable.

Fortunately, since it was HA, I was able to fail over to the secondary and keep things going. However, the problem was exacerbated by the fact I had not updated the firmware in almost 3 years.

I assumed I would need to do a complete re-install, but I found the excellent set of scripts, opnsense-update (https://github.com/opnsense/update) containing just the tool I needed, opnsense-bootstrap. With this, I was able to do an upgrade from 22.1 to 24.1 in one step, and doing the equivalent of a clean install. The result exceeded expectations.

Upgrade to 22.1

Fortunately, with a lot of sweating, I upgraded the system from 21.7 to 22.1. This was required as opnsense-upgrade needed a newer Python version than was available on 21.7. I made a snapshot of the disk image, then did the upgrade to 22.1. At one point, I was forced to revert the snapshot as the system was too corrupted to work correctly, but I was able to finally do it.

Perform the upgrade

I had a router with a similar configuration running 23.7, so I decided to only use opnsense-bootstrap to go that far. This required the following commands from the command line.

fetch https://raw.githubusercontent.com/opnsense/update/master/src/bootstrap/opnsense-bootstrap.sh.in
sh ./opnsense-bootstrap.sh.in -r 23.7

Result

The script removed the existing installation, then downloaded and installed 23.7. It appears to me that this was the equivalent of doing a fresh install, then importing the configuration, the difference being:

  • I have some custom scripts that run on the router, and they ran well
  • I had to do an update on a couple of plugins before they would start
  • Total time for the entire process was probably less than doing a fresh install as I did not have to recreate my customization
other/networking/opnsense/upgrade.txt · Last modified: 2024/09/27 16:06 by rodolico