Upgrade
The short version
Section titled “The short version”cd ownauthgit pullcd dockerdocker compose builddocker compose up -dMigrations run at boot, under a Postgres advisory lock, before the first request is served. The health check has a 30 second grace period for exactly that.
What survives, and what does not
Section titled “What survives, and what does not”| Survives | Why |
|---|---|
| accounts, sessions, organizations | they are rows in your database |
| existing sessions | the cookie is signed with BETTER_AUTH_SECRET, which you did not change |
| issued JWTs | the JWKS keys are unchanged |
| your config file | it is a volume, not part of the image |
| Does not survive | Why |
|---|---|
| in-flight requests during the restart | expected |
| anything you edited inside the container | the image is replaced; edit the repo or the config volume |
Back up first, twice
Section titled “Back up first, twice”docker exec docker-db-1 pg_dump -U ownauth ownauth > ownauth-$(date +%F).sqlcp config/auth.config.yaml config/auth.config.yaml.$(date +%F)The settings page already keeps one previous version as auth.config.yaml.bak, but that is one
generation, not a backup policy.
The secret is load-bearing
Section titled “The secret is load-bearing”BETTER_AUTH_SECRET encrypts the JWKS private keys and signs session cookies. If it changes:
- every session becomes invalid,
- every issued JWT fails verification,
- and the instance refuses to boot with
BETTER_AUTH_SECRET does not match this instancerather than failing mysteriously later.
That refusal is the feature. To rotate deliberately: truncate the jwks table, then start with the new
secret. Every session and token becomes invalid, by design.
Rolling back
Section titled “Rolling back”git checkout <previous-tag>cd docker && docker compose build && docker compose up -dMigrations are additive in practice but not guaranteed reversible. If a release adds a table, an older version ignores it; if it changes one, restore the dump instead of downgrading.
Verify the upgrade
Section titled “Verify the upgrade”curl -s localhost:3000/api/healthCheck version, database.ok, and that schema and searchPath are what you expect. Then open the
console: the Overview page shows the version and the uptime, and Configuration shows the resolved
settings.
If you run the repository yourself, bash scripts/cleanroom.sh proves the current main installs from
scratch before you point your production instance at it.