OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: Taomyn on January 30, 2023, 10:07:12 AM

Title: Upgrade vs Clean Install
Post by: Taomyn on January 30, 2023, 10:07:12 AM
I'm debating doing a fresh install of OPNsense of v23.1 rather than upgrading from v22.7 but I'm wondering if it's worth it.


I don't recall what version my install started at but it's been pretty reliable, though one thing that's been on my mind is that it's still running on UFS with the new default being ZFS. Is it worth a clean upgrade just to get on ZFS or should a wait until I am forced e.g. new hardware or total loss?


The thing that holds me back is recreating all the "custom" stuff that isn't backed up normally e.g. I have scripts that execute speed tests against 5 servers, some custom commands for Unbound and who know how many other tweaks I have probably forgotten about. I'd be installing to a new drive so getting anything back shouldn't be too difficult, just a pain, also fully reverting will be simple.


Also, is it just a case of backing up the current installation, copying that to a USB drive then pointing the installer to that file?
Title: Re: Upgrade vs Clean Install
Post by: iBROX on January 30, 2023, 11:07:30 AM
Hi,

That's what I've done for the 23.X release. Fresh install and then resorted the config from a USB. Just make sure your config sits in a directory called conf, so like this /conf/config.xml

Once it is restored the system will reboot and all is good. Of course you will need to backup your custom scripts you have mentioned as well, I've had no issues doing it the way I have described Above.
Title: Re: Upgrade vs Clean Install
Post by: abulafia on January 30, 2023, 01:16:09 PM
Quote from: Taomyn on January 30, 2023, 10:07:12 AM
Is it worth a clean upgrade just to get on ZFS
Absolutely.

Being able to do snapshots and backup boot environments (bectl) prior to upgrades is a god-send.

Quote from: Taomyn on January 30, 2023, 10:07:12 AM
The thing that holds me back is recreating all the "custom" stuff that isn't backed up normally e.g. I have scripts that execute speed tests against 5 servers, some custom commands for Unbound and who know how many other tweaks I have probably forgotten about. I'd be installing to a new drive so getting anything back shouldn't be too difficult, just a pain, also fully reverting will be simple.
You could try to run a "diff" (compare directories etc.) between the two filesystems to find esp. custom scripts, config files etc.

Quote from: Taomyn on January 30, 2023, 10:07:12 AMAlso, is it just a case of backing up the current installation, copying that to a USB drive then pointing the installer to that file?
Basically yes. You may have issues initially e.g. having to reinstall plugins  / repos but those can usually be sorted out pretty easily.
Title: Re: Upgrade vs Clean Install
Post by: SpinningRust on February 02, 2023, 12:50:31 PM
Quote from: Taomyn on January 30, 2023, 10:07:12 AM
Also, is it just a case of backing up the current installation, copying that to a USB drive then pointing the installer to that file?

The following article (https://homenetworkguy.com/how-to/migrate-opnsense-to-new-hardware/) helped me, but since I'm new to OPNsense and was simply just changing out hardware (with different interface names), I didn't have too much else to think about other than changing the interface names and then reinstalling plugins afterwards. It's nice that OPNsense will flag the plugins that are missing.

Two tips:
1. Config backup should be unencrypted
2. I found that I not only needed to re-enable root but also temporarily disable MFA. Be sure to do this before backing up the config.
Title: Re: Upgrade vs Clean Install
Post by: EdwinKM on February 02, 2023, 06:24:18 PM
Quote from: abulafia on January 30, 2023, 01:16:09 PM

Being able to do snapshots and backup boot environments (bectl) prior to upgrades is a god-send.

If i understand correctly you can completely rollback? I really miss this feature in OPNsense (compared with TrueNAS). Someone created a guide?

Title: Re: Upgrade vs Clean Install
Post by: Patrick M. Hausen on February 02, 2023, 07:02:45 PM
I did:

https://forum.opnsense.org/index.php?topic=25540.msg122731#msg122731
Title: Re: Upgrade vs Clean Install
Post by: SpinningRust on February 02, 2023, 10:16:13 PM
Quote from: pmhausen on February 02, 2023, 07:02:45 PM
I did:

https://forum.opnsense.org/index.php?topic=25540.msg122731#msg122731

This is so cool, thanks for linking to your previous guide. Really appreciate it since I'm new to OPNsense. Reminds me of dual root partitions in Junos...
I'm excited to try this for the next major upgrade.
Title: Re: Upgrade vs Clean Install
Post by: Taomyn on February 03, 2023, 06:44:00 AM
Thank you all for the responses, very much appreciated, busy week so wasn't able to check this thread until now.


Hopefully I can give a clean upgrade a go soon during a time I can afford to be without Internet for a few hours - may be a good opportunity to test out my standby RPi-4 running OpenWRT, it's been a while.
Title: Re: Upgrade vs Clean Install
Post by: Taomyn on March 20, 2023, 12:59:51 PM
Just to follow up, I was finally able to put in the time to upgrade to v23 using a clean install to import the old config - I was able to try it live off the USB installer which worked without a hitch, then did a ZFS install to a new SSD, rebooted and all was pretty much ok.


The extras I needed to do were:
And that was it - so far it's all been working fine for a few days, HAProxy, WireGuard, firewall rules, all like before.


Great job OPNsense team  8)