Accidentally updated to postgresql 17.5

I have nextcloud-aio running in docker and recently did an update to all of the containers without thinking much about it. Per logs, it isn’t starting because the postgresql database files were for version 16 and not compatible with 17.5. I was dumb and didn’t follow or even know about the migration guide by doing a dump first. How do I recover? Or do I have to start over? I was hoping I could just create a new container with the older image and keep all paths and variables the same.

I tried different tags but only latest seemed to work.

Any help is appreciated! Thank you!

Hi, can you post the docker run command or docker compose file here that you used?

Ouch, easy mistake to make :sweat_smile: You should be able to recover by spinning up a Postgres 16 container and pointing it to your existing data directory. Keep all paths/volumes the same. Once it’s running, dump the DB, then upgrade to 17 and restore the dump.

Let me know if you need help with the docker commands.

I am using portainer and created this stack:

version: “3.8”
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer
services:
nextcloud:
image: nextcloud/all-in-one:latest
restart: always
container_name: nextcloud_aio_mastercontainer
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 7282:8080
environment:
- APACHE_PORT=11000
- SKIP_DOMAIN_VALIDATION=true

I updated the containers individually and accidentally upgraded the posgresql container without properly migrating.

This is not how this should be done. The AIO interface running on port 7282 takes care of updating all the sibling containers correctly.

I tried that but couldn’t get it to work. Probably missing scripts or certain parameters. The postgresql version I had was installed using the nextcloud-aio stack. I tried to copy all parameters over but couldn’t get it to properly start. I’m pretty new to docker so forgive me for being a total noob.

I was hoping I could just modify the pull link to a variant of version 16 instead of :latest but that didn’t work. If there was a path to a previous version, that would be the easiest route I think.

ghcr.io/nextcloud-releases/aio-postgresql:latest

Can you try to restore a backup from before the update via the AIO interface running on port 7282?

Yeah, I think that is something I’ll have to do. Delete containers, remake and restore the backup. Fortunately, files are all still good. Was just hoping I could change the postgresql container and have it functioning again.

Thanks!