SOLVED Updating PHP in Nextcloud jail

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
I am running Nextcloud 17 with PHP 7.1 in an iocage jail under FreeNAS 11.2-U7.
As the PHP version will be EOL soon, I am trying to make a plan to upgrade.

I can´t find a decent guide on doing this. I suspect it´s not as simple as removing the PHP71 package and install a PHP73 one? Does someone have something similar to a guide on doing this? And which version to go for? Any recommendation there?

I also have a few friends I´ve helped with setting NC up, and a couple of them are on PHP 7.0 so they really need an update, which they are (of course) relying on me to provide. So I´d really like it to work rather smoothly....
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Well, it's a jail, so if you take a snapshot (make sure it's recursive) and then have a shot at what you suggested (seems like it should work if Nextcloud supports that newer version), the great, if not, roll back the snapshot and no harm done.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
Don't know if this is the proper way but this is what I do. Run pkg info to get a list of all the packages currently installed in your nextcloud jail. Save the list to a file on your desktop. Also open up your php config file and save that as well. Delete the PHP71 package and install the php73 package. Run pkg info again and if there are any php packages missing that were there before install them. Restore your php config file and you should be good to go.
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
@Jailer, I gave it a shot. But when I was about to pkg install nextcloud-php73, I only got version 16.0.4. Same for both php72 and php71. As I was running NC 17.0.1 before I started all this, I get this warning in the browser:
Code:
Downgrading is not supported and is likely to cause unpredictable issues (from 17.0.1.1 to 16.0.4.1)


And I get the same message trying to update:
Code:
su -m www -c "php ./occ upgrade"


Rolling back the snapshot did not save me either. It is recursive, but it didn´t even replace php72 with php71.
So now I don´t know what do to. Reinstall? I´d rather not. Do you have something that could save me?
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
Ok, I got as far as rolling back the snapshot from earlier. so now i´m back up and running.
*phew*

but the upgrade question is still valid. shouldn´t there be a somewhat simpler way to do this? Everybody needs to do this from time to time to keep up with the time, right?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
@Jailer, I gave it a shot. But when I was about to pkg install nextcloud-php73, I only got version 16.0.4. Same for both php72 and php71
That's likely because jails by default are on the quarterly package repo. You need to do a pkg override to get on the latest repository.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
A shameless plug for my blog, but I wrote about doing just that here. It's a little old, and I've since updated to php73, so just replace the 2 with a 3 :D
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
@Jailer, you´re correct, my NC jail was on quarterly. I changed it, did pkg update, and got this:
Code:
Newer FreeBSD version for package py36-msgpack:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1103000
- running kernel: 1102000
Allow missmatch now?[Y/n]:


The jail is running 11.2, same as the FreeNAS version. Do I really want to allow this? What could happen if I do?
Or should I wait for FN 11.3?

As a test, a setup a new jail, with 11.3 and did the same thing. Of course, it found the 17.0.1 version of Nextcloud, so it solves that...
What to do?

@adrianwi I installed the nextcloud-php71 package. Feels a bit strange to keep that with php 7.2 or 7.3. Is that what you did? I can´t see a new nextcloud package in your list...?
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
@adrianwi I installed the nextcloud-php71 package. Feels a bit strange to keep that with php 7.2 or 7.3. Is that what you did? I can´t see a new nextcloud package in your list...?

I didn't install Nextcloud with a PHP dependency, so not it's not. I'd update PHP and if it removes Nextcloud, just put that back without the -php7x.

Snapshot before you do in case it breaks :D

ps: Its OK to allow the mismatch, although not ideal. It's caused because FreeBSD 11.2 is now EOL, but FreeNAS is still using this. One solution is to update FreeNAS to 11.2-U7 and then you can upgrade the jails to an 11.3-RELEASE which is still supported.
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
I didn't install Nextcloud with a PHP dependency, so not it's not. I'd update PHP and if it removes Nextcloud, just put that back without the -php7x.

Snapshot before you do in case it breaks :D

ps: Its OK to allow the mismatch, although not ideal. It's caused because FreeBSD 11.2 is now EOL, but FreeNAS is still using this. One solution is to update FreeNAS to 11.2-U7 and then you can upgrade the jails to an 11.3-RELEASE which is still supported.

I thought about that. I am running 11.2-U7, but do i really want to run a jail on a different version than FreeNAS? That also feels a bit weird...
And, if I pkg search nextcloud, I don´t see an option without php7x at the end. Did you install it in a different way?
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
One solution is to update FreeNAS to 11.2-U7 and then you can upgrade the jails to an 11.3-RELEASE which is still supported.

I also cannot find a way to upgrade the jail to 11.3. It seems to be possible in the jail settings, but it´s greyed out. I have both 11.2 and 11.3 fetched. A lot of forum posts claim it´s not possible to run a jail with a higher bsd-version than the system has. But I could run a new jail if I installed with 11.3 to begin with, so maybe that´s been improved? but how to upgrade?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
@dnilgreb how did you install Nextcloud, plugin or manual install in a standard jail?
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Haha! Yes, it does seem a little weird running FreeBSD 11.3 inside a jail on a FreeNAS system running 11.2, but I'm trusting the fact it allows you to do it. I upgraded all of mine some weeks back, and they are working fine.

You're right. I installed Nextcloud quite some time ago, and followed this guide, replacing the ownCloud references with the appropriate ones for Nextcloud. I didn't realise the pkg install nextcloud makes you pick a PHP flavour. Why don't you just go for the 72 or 73 versions, which should pull the relevant dependencies?

I've been running at 7.3.11 with Nextcloud for some time without any issues.

Remember to snapshot before making any changes, that way you can roll back if anything breaks!
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
Haha! Yes, it does seem a little weird running FreeBSD 11.3 inside a jail on a FreeNAS system running 11.2, but I'm trusting the fact it allows you to do it. I upgraded all of mine some weeks back, and they are working fine.

You're right. I installed Nextcloud quite some time ago, and followed this guide, replacing the ownCloud references with the appropriate ones for Nextcloud. I didn't realise the pkg install nextcloud makes you pick a PHP flavour. Why don't you just go for the 72 or 73 versions, which should pull the relevant dependencies?

I've been running at 7.3.11 with Nextcloud for some time without any issues.

Remember to snapshot before making any changes, that way you can roll back if anything breaks!
Ok, I´ll give it a shot. As soon as I understand how to upgrade my 11.2 jail to 11.3. Any thoughts on that?
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
It should just be
Code:
iocage upgrade jailname -r 11.3-RELEASE
from the FreeNAS CLI. You might be able to do this in the WUI too.
 

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
Yup. Got it done via the CLI command.
And it worked! Now running PHP 7.3
For the record, after updating to 11.3 I went with Jailers method for upgrading PHP.
My php73-pecl-smbclient isn´t working though. Will look at that tomorrow. Any experience in that?

Thanks everybody!
 

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
Sorry about replying a little old.

I originally installed nextcloud manually via the nextcloud-php72 package. Given EOL of 7.2 soon, what's the best strategy to upgrade to 7.4? After snapshotting do I just install nextcloud-php74 over the top, or do I just install php74 or do I just tear down and rebuild the jail?
 
Top