-
Notifications
You must be signed in to change notification settings - Fork 55
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
Docker upgrade database #4650
Conversation
Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found: |
5144dd2
to
a06e23f
Compare
Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found: |
1 similar comment
Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found: |
docker/postgres_upgrade.sh
Outdated
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') |
There was a problem hiding this comment.
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;')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Will change.
Might also be worth using the |
Will do. |
Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found: |
2 similar comments
Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found: |
Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found: |
e71cd04
to
39b265d
Compare
ce904da
to
53bfdf1
Compare
53bfdf1
to
8633fc4
Compare
0864ce4
to
9913a10
Compare
There was a problem hiding this 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!
* Automate ugprading a database from 12 to 14. * parameterize source conversion and target test database service versions. --------- Co-authored-by: Damon Haley <damon.haley@nrel.gov>
* add django-2-f-a library * 2fa base install * import 2factor templates * cleanup * move two_factor to landing * functional * styles * defining styles in two_factor _base * styling and navigation * link * hide/show terms * override login view to redirect user * functional * precommit * styles * lint * update login test * precommit * redirect to login not landing_page * 2fa handles redirect, not landing * hide terms on auth and preserve url on seed home * precommit * conditionally show create act * precommit * Speed up ali tree (#4654) * Speed up ali tree * Fix Tests * Docker upgrade database (#4650) * Automate ugprading a database from 12 to 14. * parameterize source conversion and target test database service versions. --------- Co-authored-by: Damon Haley <damon.haley@nrel.gov> * Postgres 16 upgrade documentation (#4651) Added documentation for upgrading Postgres and TimescaleDB to the latest version * Fix email (#4642) * Fix email * Fix * Fix * Fix package.json * map from property_view_id not id --------- Co-authored-by: Katherine Fleming <2205659+kflemin@users.noreply.github.com> Co-authored-by: Nicholas Long <1907354+nllong@users.noreply.github.com> Co-authored-by: Nicholas Long <nicholas.long@nrel.gov> * conflicts * Update portfolio summary (#4666) * new stats table * commitment sqft added to goal * actions to goal stats table * stats table, actions dropdown * stats, create goal_notes for newly uploaded properties * add current cycle property ids to goal get * actions dropdown and base for bulk goalnote edit * bulk update goalnote * bulk update historical note * rename * precommit * permissions and tests * lint * permission refactor * permission refactor * lint * phrasing * small language update and added translations --------- Co-authored-by: kflemin <2205659+kflemin@users.noreply.github.com> * add org.require_2fa * global require_2fa var but unable to skip wizard steps * troubleshooting redirects to setup * base for custom ui * qrcode lib * functional * testing * functional - need modal * modal functional * require 2 factor org setting * precommit * lint * guard against no devices * pharsing * fix tests * precommit * styling and translations * remove blanks * precommit * lint * revert requirements * hide resend email from profile * minor tweeks * precommit * handle 500 api responses * lint * fix migration * remove duplicate --------- Co-authored-by: Hannah Eslinger <heslinge@nrel.gov> Co-authored-by: Damon Haley <dhaley@users.noreply.github.com> Co-authored-by: Damon Haley <damon.haley@nrel.gov> Co-authored-by: Alex Swindler <alex.swindler@nrel.gov> Co-authored-by: Katherine Fleming <2205659+kflemin@users.noreply.github.com> Co-authored-by: Nicholas Long <1907354+nllong@users.noreply.github.com> Co-authored-by: Nicholas Long <nicholas.long@nrel.gov> Co-authored-by: Ross Perry <ross.perry@Rosss-MBP-2.home> Co-authored-by: Ross Perry <ross.perry@192.168.1.4> Co-authored-by: Ross Perry <ross.perry@rosss-mbp-2.lan>
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)