The correct way to upgrade a Jail?

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I've recently updated to 12.0-U1 (from 11.3-U5) and that process was pretty painless. All my jails restarted and after restarting a few services I had my shares and all VMs working as the way before, which is great.

I've been having a few problems upgrading the jails though, mainly where there's a database involved. Now, some of this is probably down to my limited knowledge of how this all works, and even through I've been able to successfully follow guides and even roll my own jails based loosely around some of those guides, I'm still not 100% up to speed on how all the components work under the hood.

I started with a jail that I'm no longer using (Calibre) which appeared to upgrade fine, although I never tested the application afterwards. It took over an hour though, and someone had posted removing the /usr/src folder beforehand would speed things up so I tried another jail I only run occasionally (Plex) and this cut the time in half and everything appeared to work, including the application afterward.

Feeling somewhat brave, I then a jail I do have running but don't use much (MediaWiki) and this is where I hit some problems. MediaWiki don't come back online and some investigation suggested the database service wasn't started. I ran pkg update and upgrade but still no joy, and eventually tried to roll back the jail but this didn't help. It was one I had some instructions on how to build, and I hadn't really done much with it so spent a few hours rebuilding it, which was a good test of that. It started me worrying about the others though.

The next one I tried was Airsonic, and that worked fine after a pkg update and upgrade so I then tried LimeSurvey which was built using a very similar guide to the MediaWiki one. Expecting the worse, that one worked fine after a pkg update and upgrade, so I moved onto the more critical ones.

OpenVPN also upgraded fine and started back up after a pkg update/upgrade, as did emby which is in almost constant use, but I know would be simple enough to rebuild if it broke.

I also used Nextcould daily so was a little apprehensive, and like the MediaWiki one this didn't work, even after a pkg update and upgrade. A bit more googling suggested there should be other things to run after upgrading FreeBSD, and while I tried some of these I couldn't get things running. Expecting I might need to rebuild, I rolled back the jail and mounted databases, and to my surprise, after a restart it worked again. Inside the jail, it has a version of 12.2-P2 which makes me think rolling back the jail didn't work, but in the WUI it's still showing 11.3-P5 which is a little confusing. I think the 12.2 is right as the versions of appears to be the latest, which wouldn't;' have been the case before updating the packages?

I have a WordPress jail to update and really don't want to break that one, so was wondering if there's a better way for me to be doing this. Should I be making sure everything is updated in the old jail before running the iocage upgrade -r 12.2-RELEASE jail command? Should I be doing anything to the new jail afterwards to update anything?

Also, where does the WUI pick up the jail version from, and why would the WUI be different to what shown when opening the shell?

Apologies for the rambling questions, but I'd like to make sure the Nextcloud jail had updated and also avoid breaking the WordPress one which might not be quite as straight forward to rebuild.

Thanks in advance
 
Last edited:

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
WordPress jail upgrade worked fine, so my advice would be:

1. make sure existing jail is up to date, running pkg update/upgrade
2. run iocage upgrade -r <RELEASE> <jail>
3. restart jail and run pkg update/upgrade
4. restart jail

At least that worked for the last jail I upgraded from 11.3 :smile:
 
Top