Nextcloud Updates and Docker

Oh hey, it has been a while since I upgraded nextcloud, has it not? 23.0.3…hm, oh boy, we’re up to 27.0.0. All the way to Hub 5! Glancing over documentation, I see that we have to do incremental updates. That is, 23.0.3→23.0.12→24.0.12→25.0.8→26.0.3→27.0.0.

The problem is, nextcloud is…finnicky. It never upgrades properly. And lo and behold, I did a docker compose pull && docker compose up -d, for 23.0.8 (I foolishly thought that was the oldest), and it gave me internal server error. Why? Oh, postgres doesn’t support 14 data in 15. I’ll…figure it out later. For now, 14 would work. (dumb)

hmmm, contacts needs updating, but it crashes via GUI when I go to my landing page. Interesting. Now I am in maintenance mode. Turning it off does nothing except prompt me to upgrade via GUI again which does the same thing. Looks like I’d have to do it via CLI …again.

The usual error of maintenance mode

sudo -u www php /www/wwwroot/nextcloud/occ maintenance:mode --off

that gives that sudo isn’t installed, can be bypassed and worked out with

docker exec -it --user www-data nextcloud php occ maintenance:mode --off

and followed by

docker exec -it --user www-data nextcloud php occ upgrade

In case the files need to be scanned again:

docker exec nextcloud sudo -u www-data php occ files:scan --all