Skip to content

Upgrade Postgres Major Version #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Upgrade Postgres Major Version #76

wants to merge 6 commits into from

Conversation

rc9000
Copy link
Member

@rc9000 rc9000 commented Dec 18, 2024

TL;DR: do not just merge this right now :)

I did some digging how to navigate an upgrade of the Postgres version, as 13 will be out of support next year. Unfortunately this is a bit of a support headache, since it needs manual converting of the Postgres files. I tried to include an easy one-command approach using the pgautoupgrade project: https://github.com/pgautoupgrade/docker-pgautoupgrade

How to use it is in the README_UPGRADE.md, which the PG 17 container also just dumps into the container log if there is a mismatch.

However most users probably start the container in the background, in Docker Desktop etc. and will still not immediately see it. So we should find a good time to create a new release in Netdisco proper, declare this the cutoff for netdisco-docker PG13, and then I'd hang out in the issues & IRC for a week or two, because people will probably need help :)

To try the instructions or just test Netdisco with PG17 in general, you can get the new container from my Dockerhub account - just use rc9000/netdisco:latest-pg17 as a drop-in replacement for netdisco:latest-postgresql.

Actual EOL for PG13 is November 13, 2025 so there is no rush.

@rc9000
Copy link
Member Author

rc9000 commented Apr 30, 2025

IRC log: after some discussions we decided that a separate container with pg17 would be nice, that the user can enable at will instead of being forced into it:

14:01 < rc9000> one way i could see instead: we make an alternative netdisco-postgresql17 
                container that includes the autoupgrade but is commented out in docker-compose, plus some notes that the user can
                switch to it when they know they have a valid backup or don't care, or just want to start over with a new db?
14:01 < rc9000> this would be nontrivial since we need to merge the whole pgautoupgrade into our entrypoint, but definitely doable.
14:01 < rc9000> (the relevant bits are around here https://github.com/pgautoupgrade/docker-pgautoupgrade/blob/main/postgres-docker-entrypoint.sh#L567)
15:01 < oliver> rc9000: yes I was thinking along these lines ... a straightforward thing the user could do (change a text config and restart) to opt in to the upgrade
17:10 < rc9000> oliver: ok let's rescope the pr so there is a new container that can be enabled, and then we can slowly get people into switching over.
17:11 < rc9000> that's also nice because there is no big bang
17:14 < rc9000> should we just append the major version like so?
17:14 < rc9000> netdisco:2.084002-postgresql17
17:14 < rc9000> netdisco:latest-postgresql17
17:14 < rc9000> ... time passes
17:14 < rc9000> netdisco:2.084002-postgresql22
17:14 < rc9000> netdisco:latest-postgresql22
17:15 < rc9000> and we could also push the current one additionally as netdisco:latest-postgresql13 for symmetry
17:52 < oliver> rc9000: yes would be OK but I'd like to check for anything like a loop over the suffix on the image name which would be caught out 
                (like for i in do backend frontend postgresql...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant