Closed GoNzCiD closed 2 years ago
Thanks to the combined workarounds found here I can go ahead but now I have another error......
...
Checking for presence of required libraries ok
could not create hard link between old and new data directories: Invalid cross-device link
In link mode the old and new data directories must be on the same file system.
Failure, exiting
To not use the --link parameter works for me.
After that have to copy/update the pg_hba.conf
file to the new folder.
Thank you @GoNzCiD. I used docker-postgres-upgrade for a previously failed Matrix Synapse database upgrade from PostgreSQL 11 to 13 with the following final command. Your clues were valuable to me.
POSTGRES_USER="synapse"
POSTGRES_PASSWORD="synapse-password"
OLD=11
NEW=13
OLD_DATA="/matrix/postgres/data-auto-upgrade-backup"
NEW_DATA="/matrix/postgres/data"
sudo docker run --rm \
-e PGUSER="$POSTGRES_USER" \
-e POSTGRES_INITDB_ARGS="-U $POSTGRES_USER" \
-e POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \
-v "$OLD_DATA":"/var/lib/postgresql/$OLD/data" \
-v "$NEW_DATA":"/var/lib/postgresql/$NEW/data" \
"tianon/postgres-upgrade:$OLD-to-$NEW"
cp -a /matrix/postgres/data-auto-upgrade-backup/pg_hba.conf /matrix/postgres/data/
If anyone else ends up where I did, also check the ownerships and permissions of /matrix/*.
Thank you, @tianon, for docker-postgres-upgrade!
Hi, I'm trying to migrate from 12 to 13, but I have the error
role "postgres" does not exist
. It's normal because this database doesn't contain this role, is there any way to specifiy it?I've tried with
docker run --rm -v /docker/postgres:/var/lib/postgresql -e POSTGRES_PASSWORD=pas**rd -e POSTGRES_USER=us@r tianon/postgres-upgrade:12-to-13 --link
but it seems to me that the environment variables ar not set. :(