generated from coop-cloud/example
Update to postgres 15 and run pg_upgrade automatically #15
Reference in New Issue
Block a user
No description provided.
Delete Branch ":pg15"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
created an entryscript that check for incorrect
PG_VERSION. if so, it downloads the old binaries and performs an update viapg_upgradeinspired by:
cf5c8609a7/upgrade/docker-upgrade-entrypoint-wrapper.shworks well for migrating from postgres 11 as well as deploying a fresh instance
Great stuff!
@ -0,0 +5,4 @@NEWDATA=$PGDATA/new_dataif [ -e $MIGRATION_MARKER ]; thenecho "FATAL: previous migration not completed. manual restore necessary"Can we help with a from which version to which we need to handle the manual restore with?
I don't know in which state the migration did not complete, its just a safety mechanism to stop interrupted migrations that are in an unclear state. With restore I mean to restore the hopefully made backup. Does this make it more clear?
@ -0,0 +19,4 @@postgresql-$DATA_VERSION \&& rm -rf /var/lib/apt/lists/*echo "shuffling around"gosu postgres mkdir $OLDDATA $NEWDATAIs
gosudefinitely already installed? I guess it could be included in theapt-installstuff above to help make it more portable. Just noting this thought in case it's useful.gosuis used in the vendordocker-entrypoint.sh. Its not portable to-alpine, but wouldn't be withapt-installeitherLGTM @iexos! Perhaps some Autonomicz have some thoughts on this as they maintain Outline stuff too /cc @3wordchant @cas @knoflook Not sure who else to ping atm, feel free to merge from my side
We hot tested this on our outline and it worked, modulo a tiny change without which it fails in a most alarming manner, see inline.