Upgrading
Upgrades between minor versions can include database migrations, configuration changes, or API adjustments. Always upgrade deliberately, not automatically — pin your Docker image tag to a specific version (e.g. 0.16.2) so that a container restart never crosses a release boundary on its own.
Upgrade checklist
Read the changelog between your current version and the target version. CHANGELOG.md on GitHub lists every release. Pay special attention to:
- Breaking changes — API shape changes, renamed fields, removed endpoints
- Migration requirements — new database columns, backfills, long-running schema changes
- Configuration changes — new required env vars, renamed or deprecated ones
Back up
/data. See the Backups page. Don't skip this even for minor version bumps — migrations are forward-only, and recovering from a failed migration may require a snapshot.Have a rollback plan. If the upgrade fails or reveals a regression:
- With a volume snapshot, you can restore
/dataand roll back to the previous image tag. - Without a snapshot, rollback means restoring from application-level backups (export policies as YAML before upgrading, re-import after rollback).
- With a volume snapshot, you can restore
Test in a staging environment first if you have one. The staging data source can point at a clone of your production upstream.
Pull the new image.
shdocker pull ghcr.io/getbetweenrows/betweenrows:0.16.2Stop the old container, start the new one with the same env vars and volume mount.
shdocker stop betweenrows docker rm betweenrows docker run -d \ --name betweenrows \ --restart unless-stopped \ -e BR_ADMIN_PASSWORD="$BR_ADMIN_PASSWORD" \ -e BR_ENCRYPTION_KEY="$BR_ENCRYPTION_KEY" \ -e BR_ADMIN_JWT_SECRET="$BR_ADMIN_JWT_SECRET" \ -p 5434:5434 -p 5435:5435 \ -v /srv/betweenrows/data:/data \ ghcr.io/getbetweenrows/betweenrows:0.16.2Or with Docker Compose: change the
image:tag incompose.yamland rundocker compose up -d.Watch the logs for migration output.
shdocker logs -f betweenrowsMigrations run automatically on startup. You should see messages indicating each migration applied and the final "ready" or "listening" log line. A crash during migration is a serious event — stop, investigate, and restore from the backup if necessary.
Verify the admin UI loads at port 5435 and you can log in.
Verify the data plane by connecting with psql as an existing user and running a query you know should work. Check the Query Audit page to confirm the query was processed normally.
Spot-check a policy. Pick a non-trivial policy and run a test query that should be filtered/masked. Confirm the rewritten SQL in the audit log matches what you expect.
Fly.io upgrade
On Fly, the same pattern but via flyctl:
# Read the changelog first, then back up the volume:
fly ssh console --app <your-app-name> -C "tar -czf /tmp/data.tgz /data"
fly ssh sftp get /tmp/data.tgz ./data-backup-$(date +%F).tgz --app <your-app-name>
# Deploy the new image
fly deploy --image ghcr.io/getbetweenrows/betweenrows:0.16.2 --app <your-app-name>
# Tail logs during rollout
fly logs --app <your-app-name>See Install on Fly.io for the full deployment reference.
Migration safety
Database migrations run automatically on startup. Do not manually edit the seaql_migrations table or the admin database files. If a migration fails and you cannot recover cleanly, restore from your backup and file a GitHub issue with the full logs.
Downgrading
Downgrades are not supported. SeaORM migrations are forward-only. If you need to roll back:
- Stop the new container.
- Restore
/datafrom the snapshot taken before the upgrade. - Start the old image version.
If you've made policy changes between the upgrade and the rollback, capture them first by snapshotting the admin database (see Backups) — there is no YAML export API yet.
Version pinning in CI/CD
If you deploy BetweenRows via an IaC or GitOps workflow, pin the tag in source control:
# compose.yaml
services:
betweenrows:
image: ghcr.io/getbetweenrows/betweenrows:0.16.2 # not :latest# terraform
resource "fly_app" "betweenrows" {
image = "ghcr.io/getbetweenrows/betweenrows:0.16.2" # not :latest
}Treat version bumps as deliberate PRs — with changelog review in the PR description and a small smoke-test playbook in the pipeline.
See also
- Changelog — version history and breaking changes
- Backups — what to snapshot before upgrading
- Troubleshooting — if something goes wrong