Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify a user & password #34

Closed
GoNzCiD opened this issue Oct 21, 2020 · 3 comments
Closed

Specify a user & password #34

GoNzCiD opened this issue Oct 21, 2020 · 3 comments

Comments

@GoNzCiD
Copy link

GoNzCiD commented Oct 21, 2020

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. :(

@GoNzCiD
Copy link
Author

GoNzCiD commented Oct 21, 2020

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

@GoNzCiD
Copy link
Author

GoNzCiD commented Oct 21, 2020

To not use the --link parameter works for me.
After that have to copy/update the pg_hba.conf file to the new folder.

@jooize
Copy link

jooize commented Nov 24, 2020

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!

Repository owner locked and limited conversation to collaborators Feb 25, 2022
@tianon tianon converted this issue into discussion #49 Feb 25, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants