diff options
author | 2019-10-11 21:59:20 +0200 | |
---|---|---|
committer | 2019-10-11 22:14:28 +0200 | |
commit | 382c5121912e25a5609208291885e21c8b63d459 (patch) | |
tree | 20546611454f42e4a1b86f6e12c1bb3fcf40d4b8 | |
parent | Merge pull request #281 from python-discord/simple-admin-log-entry-view (diff) |
Bump PostgreSQL in compose.
This might break local PostgreSQL containers with the following error:
postgres_1 | 2019-10-11 20:01:48.772 UTC [1] FATAL: database files are incompatible with server
postgres_1 | 2019-10-11 20:01:48.772 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.0.
You will need to do one of the following:
- Delete the old data volume and start from scratch (simple, recommended).
As we don't have an explicit volume configured, only the one the PostgreSQL
image uses, this is as simple as running `docker-compose stop` followed by
`docker-compose rm`. Afterwards, you can restart it.
- The dump & restore route. Do this if you don't want to delete your
container data. To do this, first switch the PostgreSQL version in
`docker-compose.yml` back to `11`, then run the following commands:
docker-compose stop # Stop all containers
docker-compose start postgres # Start the database
docker-compose exec postgres pg_dumpall -U pysite > db.sql # Pull a SQL dump
docker-compose stop # Stop the containers again
docker-compose rm # Remove the containers
Now, update the PostgreSQL version in `docker-compose.yml` to `12` again,
and run the following commands:
docker-compose up -d postgres # Start the database
docker-compose exec -T postgres psql -U pysite < db.sql # Pull in the dump
rm db.sql # Cleanup garbage, if you want
If you're on Windows, then I can't help you. Sorry.
-rw-r--r-- | docker-compose.yml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index 3a2e5398..3884a41f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ version: "3.6" services: postgres: - image: postgres:11-alpine + image: postgres:12-alpine ports: - "127.0.0.1:7777:5432" environment: |