pgautoupgrade
This is a PostgreSQL Docker image to automatically upgrade your database.
Its whole purpose in life is to automatically detect the version of PostgreSQL used in the existing PostgreSQL data directory, then automatically upgrade it (if needed) to the required version of PostgreSQL using pg_upgrade with the --link option.
After this, the PostgreSQL server starts and runs as per normal. The old cluster data will be removed.
The reason this Docker image is needed, is because the official Docker PostgreSQL image has no ability to handle version upgrades, which leaves people to figure it out manually (not great): docker-library/postgres#37
Warning Backup your data! This Docker image does an in-place upgrade of the database data, so if something goes wrong you are expected to already have backups you can restore from.
Important Also, remove any healthchecks. Due to how we perform the update process, we had to implement our own healthcheck. So no extra healthcheck is needed.
How to use this image
This image is on Docker Hub:
https://hub.docker.com/r/pgautoupgrade/pgautoupgrade
... continue reading