Postgres 17 migration
Web dashboard v2.31.0 requires Postgres 17. Please follow this guide after upgrading to version v2.31.0 or above.
1. Backup your database
docker exec postgres pg_dumpall -U postgres > ~/backup.sql2. Update gamebench.toml
Set postgresHost to postgres17
3. Re-generate configuration
./gbctlv2 generate-config --no-interaction4. Restart containers
docker compose up -d5. Load data into Postgres 17 database
docker exec -i postgres17 psql -U postgres < ~/backup.sql6. Check the migrated data
After step 4, docker compose up -d may warn about an orphaned postgres container. This is expected. The old container keeps running until you remove it.
Confirm that your tables are in the new database:
docker exec postgres17 psql -U postgres -d elm-integration -c '\dt'Then sign in to the web dashboard and check that your data is there.
7. Remove the old container
Once you’re satisfied with the migrated data, run:
docker compose up -d --remove-orphansThis also removes any other orphaned containers in this Compose project. It does not delete your data: the Postgres 11 data stays in the pgdata volume, which you should keep until you’re sure you won’t need to roll back.
Never run docker compose down -v unless you intend to delete your database: it deletes the pgdata_17 volume, which now holds your live data.
Do not run docker volume prune -a while you may still need to roll back. Once the old container is removed, it can delete the pgdata volume.
Rolling back
Any data written after the migration exists only in Postgres 17 and will not be carried back.
- In
gamebench.toml, setpostgresHostback topostgres, and setversionto a release earlier than v2.31.0. - Run
./gbctlv2 generate-config --no-interaction. - Run
docker compose up -d.