-
Notifications
You must be signed in to change notification settings - Fork 119
Migrate a Database with different credentials than postgres #113
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
Comments
We've also hit this and not sure how to proceed. I think this can be fixed by running the pg_upgrade command manually from inside the container and create the cluster with the same insall user by passing the proper option I will try this later.
I believe I will try this over the weekend and report back. |
I think this PR is related to the issue: #72 |
I've successfully upgraded my databases using a custom upgrade command. I believe you can also upgrade your DB by changing the bootstrap user:
create user temp_user with superuser, login;
-- authenticate with temp_user and then:
alter role dfs_rw rename to postgres; I repeat: I did not try this method yet since I did upgrade my db using the manual method:
# start migration image in bash
docker run --rm -ti -u postgres --name pg-upgrade \
-v /my-db:/var/lib/postgresql \
tianon/postgres-upgrade:16-to-17 bash
# init the
/usr/lib/postgresql/17/bin/initdb -D /var/lib/postgresql/17/data -U my_user_name
# Run the migration manually
/usr/lib/postgresql/17/bin/pg_upgrade \
--old-bindir /usr/lib/postgresql/16/bin \
--new-bindir=/usr/lib/postgresql/17/bin \
--old-datadir=/var/lib/postgresql/16/data \
--new-datadir=/var/lib/postgresql/17/data \
--link -U my_user_name |
I wanted to (or have to) migrate a database from version 16 to version 17.
It seems as in the original there is no database user "postgres" available.
According to the configuration of the original application, the database user is dbroot instead of postgres and the password is a quite random string.
Is there a way to pass in these credentials into your migration tool, too?
Because when trying to run the migration script on this database, I get the following error:
The original database data folder has been copied to the 16/data folder as needed
Commands:
Output:
The basic test with migrating from PG16 to PG17 as written in your README file worked flawlessly. So I assume it has to be related to the settings of the source database.
The text was updated successfully, but these errors were encountered: