Creating this more as a how to for anyone else that’s stuggling with something similar in the future.
The task: I am running OC 10.16. something on ubuntu 20.04 and I want to upgrade to the most recent OC release 11. Partly because of the recent PHP “issues” partly because it seems like a good idea.
The “problem”: ubuntu 20.04 won’t easily take php 8.3. OC 11 needs 8.3. Ubuntu 22.04 won’t easily run 7.4 or 8.3 so is no good to anyone. Ubuntu 24.04 will run 8.3 but it won’t run 7.4. So, you really need to upgrade bother the underlying OS and the OC install at the same time.
I guess in theory this is simple… but I’ve thought that in the past.
Shut it down again, snap it again then boot and run
do-release-upgrade
Leave all existing edited files in place (option n generally)
Reboot apt update && apt dist-upgrade -y && apt autoremove -y && apt autoclean -y
( ^— probably not really needed) php -v
(^----- also probably not needed but nice to check it’s showing 8.1 at this point.)
Shutdown, snap.
Boot, do-release-upgrade
leave existing edited files as they are again, reboot, first proper problem. No network.
Edit the netplan file and update eth0 to enX0 fix routes, fix permissions on config file,
Move, extract, link data, copy config files, fix permissions
Do the upgrade (disable maintenance first)
We already have maintenance mode enabled but checking won’t hurt but it actually also won’t work because the current occ command is still the old version. Tried it anyway. sudo -u www-data ./occ maintenance:mode --on This version of ownCloud is not compatible with PHP 8.0 You are currently running PHP 8.3.6.
Need to fix apache, it’s currently trying to load the old php 7.4 modules a2dismod php7.4 && a2enmod php8.3 && apache2ctl configtest
Syntax is ok so start it up systemctl start apache2 && systemctl status apache2
All looking good, best disable again though so we don’t get any pesky clients trying to connect. systemctl stop apache2
Download latest. The docs provide a wget line that appears to download the “latest” version but that actually downloads 10.16.0 which is not 11 and not even the latest v10.16 release… sooo, head here instead and download the actual latest. cd /var/www mv owncloud owncloud-20261024 wget ``https://github.com/owncloud/core/releases/download/v11.0.0/owncloud-11.0.0.tar.bz2 tar -xf owncloud-11.0.0.tar.bz2
Copy config files over, docs then also say to link data but if I link data then setting permissions is going to take an eon so doing the perms first and taking the risk that something in my data dir might not be quite right for now. cp /var/www/owncloud-20261024/config/* /var/www/owncloud/config
Not going to copy and paste all the permissions commands, go get them from the docs.
At this point the docs don’t mention it but you have to turn maintenance mode off. The really reassuring part for me at this point was that it didn’t complain about the php version and it acknowledged that stuff needed an upgrade! looks like I’m winning…
sudo -u www-data ./occ maintenance:mode --off
ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Maintenance mode disabled
Run the update, for me this generated some errors sudo -u www-data ./occ upgrade
Had to disable some of the apps (in fairness I should have probably checked this earlier…) sudo -u www-data ./occ app:disable activity
Then run the upgrade agian, which for me worked, finally; systemctl start apache2 sudo -u www-data ./occ maintenance:mode --off
Hey Gareth!
Thank you for bringing us along on your adventure!
It is a super helpful write-up and we appreciate you doing it out in the open so folks can see and learn along with you.
It is also super helpful for me as I am planning on creating a walkthrough/tutorial for upgrading from oC10 to oC11
How are things going so far with the upgrade? Any other caveats or things you’ve noticed?
Thanks for the kind comment Jordana, you (and the community generally) are more than welcome.
If you wanted to put it in for some sort of spotlight thing then please feel free. I’ve never visited Barcelona! Although I often find that the ticket price isn’t the barrier to attending things, it’s the flights, hotels, food and drink!
When I was a lad… and first started using owncloud… Docker wasn’t a thing, it was all green fields over there! and we had to do our dev/sys ops “properly”… (but obvs any new people round here should probably go with the officially supported way)