Util: Add PostgreSQL data migration script#1520
Draft
drikusroor wants to merge 1 commit intodevelopfrom
Draft
Conversation
Evert-R
reviewed
Feb 12, 2025
| # ---------------------------------------------------------------------------- | ||
| # Step 4: Wait until PostgreSQL inside the container is ready. | ||
| # | ||
| echo "Waiting for PostgreSQL to be ready..." |
Contributor
There was a problem hiding this comment.
The script hangs here, with this error in the container in docker desktop:
2025-02-12 13:59:18 Error: Database is uninitialized and superuser password is not specified.
2025-02-12 13:59:18 You must specify POSTGRES_PASSWORD to a non-empty value for the
2025-02-12 13:59:18 superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
2025-02-12 13:59:18
2025-02-12 13:59:18 You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
2025-02-12 13:59:18 connections without a password. This is *not* recommended.
2025-02-12 13:59:18
2025-02-12 13:59:18 See PostgreSQL documentation about "trust":
2025-02-12 13:59:18 https://www.postgresql.org/docs/current/auth-trust.html
Collaborator
There was a problem hiding this comment.
I ran into something similar when doing this manually. I think what happens is that the env variables aren't loaded in this way. I solved it by running docker compose up db and then running the script afterwards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a script to facilitate the migration of PostgreSQL data between versions, automating the process of dumping and restoring databases using Docker containers.
pg_dumpall.