Closed snspinn closed 3 years ago
I am getting the same issue with 10-to-13
while upgrading a Mattermost setup.
could not open version file "/var/lib/postgresql/10/data/PG_VERSION": No such file or directory
The directory /var/lib/postgresql/10/data/
is empty inside the container. Although so is /var/lib/postgresql/13/data/
It seems like the postgres cluster has not been initialised? My database is small enough that I think a pg_restore is my best option.
P.s. Also fails with...
$ docker run --rm \
-v $PWD/data/postgres:/var/lib/postgresql/11/data \
-v $PWD/data/12/postgres:/var/lib/postgresql/12/data \
tianon/postgres-upgrade:11-to-12
@davidbartonau what base does your container image use (i.e. debian, alpine, etc?).
The other thread mentioned that permission issues as a possible root cause, but a different directory stucture could be to blame also(?)..
Re-arranging the bind volume directory structure, so that it matched the first example in the README, worked for me. i.e. ...
$ find $DIR -mindepth 2 -maxdepth 2
$DIR/11/data
$DIR/12/data
so I could run the upgrade with:
docker run --rm \
-v "$DIR:/var/lib/postgresql" \
"tianon/postgres-upgrade:11-to-12" \
--link
(Replacing $DIR
as appropriate in both snippets of course).
Don't know if there is an issue with the implementation when using the method I used above (mounting two seperate bind points) or I was just using it wrong. Either way, I will close this.
This is related/similar to #29.
The issue
I'm running a timescale postgres on pg11, launching with docker-compose. When running the upgrade I get the following output and failure message
My setup
I am starting with a docker-compose setup where I recently upgrade the timescale from 1.3.1 to 17.5 (I give this for context but I don't think this is in anyway the source of the issue).
The compose takes the pattern as following:
As you'll see, My config is already a bit outside the pattern(s) described in the README.
Steps to run upgrade
Since my PGDATAOLD is effectively mounted, quite awkwardly, as
~/DIR/data/postgres:/var/lib/postgresql/data
, may plan was to mount PGDATANEW as~/DIR/data/12/postgres:/var/lib/postgresql/data
.I didn't do any 'upgrade testing' outlined in the step outline in the README, so be kind. ;)
I ran (from within working directory):
Result
As outlined above.
Also...
FATAL: no pg_hba.conf entry for host "w.x.y.z", user "postgres", database "postgres", SSL off
. This led to further investigation, but probably not worthwhile to explain in detail here (I can supply more details if requested).