sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Add script to upgrade dev PostgreSQL version 9.6 -> 14

Open beezz opened this issue 3 years ago • 2 comments

Adding a script to upgrade your dev environment, dockerized PostgreSQL to version 14. It uses tianon / docker-postgres-upgrade docker image to do the (pg_)upgrade and re-index all databases to prevent index corruption due to glibc upgrade.

This script is useful only in case you have data you'd like to preserve. Otherwise remove Postgres and configure PG_VERSION to upgrade:

$ docker stop sentry_postgres; docker rm sentry_postgres && docker volume rm sentry_postgres
$ export PG_VERSION=14
$ sentry devservices up postgres
$ make reset-db

The plan is to change the default in the coming weeks to version 14.

beezz avatar Sep 13 '22 09:09 beezz

just so I have a little more context -- is this meant to be a tool that we support and keep indefinitely? shouldn't developers just drop their old databases and start afresh? what's the target audience here

also we should be writing new scripts that we intend to keep in python with types and ideally some tests (where relevant) rather than shell

asottile-sentry avatar Sep 13 '22 13:09 asottile-sentry

just so I have a little more context -- is this meant to be a tool that we support and keep indefinitely? shouldn't developers just drop their old databases and start afresh? what's the target audience here

Ideally, yes, developers should just drop the old db and start afresh. The audience is developers that have data in db they don't want to drop. We don't need to support/keep this script indefinitely, it can be removed a few weeks after we make the new pg version the default one.

beezz avatar Sep 14 '22 13:09 beezz

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Oct 11 '22 00:10 github-actions[bot]