Skip to content

Commit

Permalink
chore: added upgrade information
Browse files Browse the repository at this point in the history
  • Loading branch information
Kammerlo committed Mar 5, 2024
1 parent 8739ad8 commit b425be1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,20 @@ docker compose -p preview down

</details>

### Upgrade Database to Postgres 14
If you are upgrading from Postgres 11 to 14, you will need to run the following command to upgrade the database:

- Add your Database password + User into the `./scripts/db-upgrade-docker-compose.yml` file
- Adjust volumes if needed - standard is migration from volume `postgres-data` to `postgres14-data`
- Run the following command to upgrade the database:
``` console
# Start upgrading container
docker compose -f ./scripts/db-upgrade-docker-compose.yml up
# Stop it manually after the upgrade is done with cmd + c
```
- Adjust volume to the upgraded volume `postgres14-data` in the `docker-compose.yml` file
- Start the stack again

### Check Cardano DB sync progress
Use the GraphQL Playground in the browser at http://localhost:3100/graphql:
> **_Note_** This Query is not available in early Era's of Cardano. Check Points of Interest here: [Link](https://ogmios.dev/mini-protocols/local-chain-sync/#points-of-interest)
Expand Down
16 changes: 16 additions & 0 deletions db-upgrade-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.8"

services:
db-upgrade:
platform: linux/x86_64
image: pgautoupgrade/pgautoupgrade:latest
environment:
- POSTGRES_LOGGING=true
- POSTGRES_PASSWORD=doNoUseThisSecret!
- POSTGRES_USER=postgres
volumes:
- postgres-data:/var/lib/postgresql/11/data
- postgres14-data:/var/lib/postgresql/14/data
volumes:
postgres-data:
postgres14-data:
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
postgres:
image: postgres:${POSTGRES_VERSION:-12.18-bullseye}
image: postgres:${POSTGRES_VERSION:-14.10-alpine}
environment:
- POSTGRES_LOGGING=true
- POSTGRES_DB_FILE=/run/secrets/postgres_db
Expand All @@ -16,7 +16,7 @@ services:
- postgres_user
shm_size: '2gb'
volumes:
- postgres-data:/var/lib/postgresql/data
- postgres14-data:/var/lib/postgresql/data
restart: on-failure
logging:
driver: "json-file"
Expand Down Expand Up @@ -149,4 +149,4 @@ volumes:
db-sync-data:
node-db:
node-ipc:
postgres-data:
postgres14-data:

0 comments on commit b425be1

Please sign in to comment.