Content
[SOLVED] Can't update Postgresql in docker-compose enviroment
Added by Florian Krebber almost 3 years ago
Hey all,
i spent most of the day trying to get this, but i can't. I tried every possible solution i found but ALWAYS the problem seems to be that the old Postgresql 9.6 server ist not stopping - it always keeps restarting itself.
I installed Openproject via docker-compose and today did an upgrade to the last version: 12. That worked fine. But now i keep getting the message that i should upgrade to Postgresql 13. Which i tried. I tried whatever solution i can find, from ./docker/prod/postgres-db-updgrade script over doing it manually inside the container with pg_upgrade etc. NONE worked because every time shutting down the old Postgresql 9.6 didn't worked as it ALWAYS keeps restarting itself.
This is my docker-compose.yml:
version: '3'
services:
openproject:
image: openproject/community:12
restart: always
container_name: openproject_server
volumes:
- ./var/lib/openproject/pgdata:/var/openproject/pgdata
- ./var/lib/openproject/static:/var/openproject/assets
environment:
- SECRET_KEY_BASE=secret
- EMAIL_DELIVERY_METHOD=smtp
- SMTP_ADDRESS=cleared-for-security
- SMTP_PORT=465
- SMTP_DOMAIN=cleared-for-security
- SMTP_AUTHENTICATION=login
- SMTP_ENABLE_STARTTLS_AUTO=true
- SMTP_USER_NAME="cleared-for-security"
- SMTP_PASSWORD="cleared-for-security"
- DATABASE_URL=postgres://openproject:openproject@127.0.0.1/openproject
tty: true
ports:
- 8085:80
expose:
- 80
- 443
I really can't get my head around this. Is there any script in place inside the container which keeps restarting the Postgresql? Any help woul dbe much appreciated!
Thanks and take care
Florian
Replies (4)
Hey, I don't see your container definition for the postgres service. Unless you're using the all-in-one docker image? But then not really sure what you mean by "the postgres container keeps restarting". As a tip though, you should replace
restart: always
withrestart: unless-stopped
so that a manual stop by the administrator (i.e. you) really stops the container. Therestart: always
policy will have the docker daemon always restart the container, no matter what.Hey Cyril,
thanks for the info - yes, i am using the all-in-one-package. And actually it was my fault after all. Following the instructions here https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql13/ worked like a charm - i just forgot somehow to copy the new data to the old data directory. So, sorry for the fuzz!
Take care and thanks again
Florian
Great then! Thanks for the update
Hi Florian,
great to hear you were able to resolve it after all. Do you have any improvements on the migration guide? I.e., something we could have written more clearly in the guide?
Cheers
Oliver