generated from coop-cloud/example
Update to postgres 15 and run pg_upgrade automatically #15
Loading…
Reference in New Issue
No description provided.
Delete Branch "iexos/outline: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_upgrade
inspired by:
cf5c8609a7/upgrade/docker-upgrade-entrypoint-wrapper.sh
works well for migrating from postgres 11 as well as deploying a fresh instance
Great stuff!
@ -0,0 +5,4 @@
NEWDATA=$PGDATA/new_data
if [ -e $MIGRATION_MARKER ]; then
echo "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 $NEWDATA
Is
gosu
definitely already installed? I guess it could be included in theapt-install
stuff above to help make it more portable. Just noting this thought in case it's useful.gosu
is used in the vendordocker-entrypoint.sh
. Its not portable to-alpine
, but wouldn't be withapt-install
eitherLGTM @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.