Skip to main content
View as Markdown

Upgrade and roll back a Sovrium app

Schema migrations are forward-only — a released migration is never rewritten, and there is no automatic downgrade. So a safe upgrade always pairs with a backup you can restore.

Upgrade

Back up first (SQLite, or a database snapshot on Postgres), then move to the new version and restart. The schema migration runs on boot, inside a transaction, before the app serves traffic:

>_ terminal
sqlite3 .sovrium/database.db ".backup '/backups/pre-upgrade.db'"
sovrium update            # binary install; or: docker pull ghcr.io/sovrium/sovrium:latest
sovrium stop && sovrium start app.ts

If the migration fails, the transaction rolls back and the server refuses to start on an inconsistent schema — you are never left half-migrated.

Roll back

Because migrations don't reverse, a rollback restores the pre-upgrade data alongside the prior binary/image:

>_ terminal
sovrium stop
curl -fsSL https://sovrium.com/install | sh -s -- --version 0.21.0   # the version you upgraded from
cp /backups/pre-upgrade.db .sovrium/database.db && rm -f .sovrium/database.db-wal .sovrium/database.db-shm
sovrium start app.ts

For zero-downtime, run the new version as a second instance behind your proxy, verify it, then switch traffic — keeping the old instance until you're confident.

Next

Last updated September 1, 2026

This documentation was written with AI, so errors or outdated content are possible. Sovrium is in beta. Contributions and corrections are welcome.

Built with Sovrium