Skip to content
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

Docker upgrade database #4650

Merged
merged 3 commits into from May 7, 2024
Merged

Docker upgrade database #4650

merged 3 commits into from May 7, 2024

Conversation

dhaley
Copy link
Collaborator

@dhaley dhaley commented Apr 26, 2024

Any background context you want to provide?

The script ./docker/postgres_upgrade.sh will properly upgrade a database from pg12.7-(2.3.0) to pg14.11-(2.14.2). It works in conjunction with the "docker-compose.pgupgrade.yml" docker-compose file to temporarily run Timescale Postgres 13 and 14 images.

What's this PR do?

How should this be manually tested?

./docker/postgres_upgrade.sh --source-pg-conv-version 13 --source-ts-conv-version 2.11.2 --target-pg-test-version 14 --target-ts-test-version 2.11.0

What are the relevant tickets?

Screenshots (if appropriate)

@dhaley dhaley marked this pull request as draft April 26, 2024 22:00
Copy link

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

Copy link

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

1 similar comment
Copy link

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

Comment on lines 15 to 17
POSTGRES_FULL_VERSION=$(docker-compose exec -T db-postgres psql --user=seed -d postgres -c 'SELECT version();' | sed -n 3p)
# Extract the version number using regex
POSTGRES_VERSION=$(echo "$POSTGRES_FULL_VERSION" | sed -n 's/.*PostgreSQL \([0-9]*\.[0-9]*\).*/\1/p')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should just be able to use:

POSTGRES_VERSION=$(docker-compose exec -T db-postgres psql --user=seed -d postgres -t -A -c 'SHOW server_version;')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will change.

docker/postgres_upgrade.sh Outdated Show resolved Hide resolved
docker/postgres_upgrade.sh Show resolved Hide resolved
@axelstudios
Copy link
Member

Might also be worth using the --exit-on-error flag with pg_restore

@dhaley
Copy link
Collaborator Author

dhaley commented Apr 30, 2024

Might also be worth using the --exit-on-error flag with pg_restore

Will do.

Copy link

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

2 similar comments
Copy link

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

Copy link

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

@dhaley dhaley added the Feature Add this label to new features. This will be reflected in the change log when generated. label Apr 30, 2024
@dhaley dhaley marked this pull request as ready for review April 30, 2024 16:37
@dhaley dhaley force-pushed the docker-upgrade-database branch 3 times, most recently from ce904da to 53bfdf1 Compare April 30, 2024 17:19
@dhaley dhaley requested a review from nllong May 1, 2024 14:50
Copy link
Member

@nllong nllong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks @dhaley!

@dhaley dhaley requested a review from kflemin May 6, 2024 21:06
@axelstudios axelstudios merged commit 9afbe03 into develop May 7, 2024
9 checks passed
@axelstudios axelstudios deleted the docker-upgrade-database branch May 7, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Add this label to new features. This will be reflected in the change log when generated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants