Skip to content

Upgrading

Updating

Pull the new code, reinstall backend dependencies if they changed, rebuild the frontend if it changed (npm run build), and restart the backend. No separate upgrade command — restarting is the upgrade. Any database change the new version needs runs automatically, first thing on startup, before the app serves a single request.

What happens automatically when the database needs to change

Most restarts have nothing to do. When a schema change is pending, the app protects you before touching anything:

  1. Backs up the database first (SQLite installs only) — a consistent snapshot via SQLite’s own backup mechanism, next to your other backups.
  2. Verifies that backup is readable before proceeding; verification failure means the migration never starts.
  3. Only then applies the schema change.
  4. Migration fails partway? Auto-restores the verified backup from step 1 — you’re left with the working database you started with, not a half-migrated one.
  5. Anything went wrong, either way? The app refuses to start rather than come up unsure. The error explains what failed and, if the auto-restore also couldn’t complete, names the exact backup file to restore by hand.

Deliberate fail-closed design: the app would rather not start than start on data it can’t vouch for. Fails to boot after an update? The fix is almost always in the log message — read it before trying anything else.

Running a non-SQLite database (advanced setup)? The app doesn’t take this automatic backup for you — take your own database-level backup (e.g. pg_dump) before upgrading, then set ONW_MIGRATE_ASSUME_BACKUP=1 to tell the app you’ve done so before it proceeds with a pending schema change. Without it, the app refuses to migrate a non-SQLite database at all.

Before a significant upgrade

The automatic protection above covers the schema change itself, but a manual backup (“Back up now” in Settings → Data) before a bigger version jump is still good practice, same as before any software update touching your data.

  • operations/backup-and-restore — the backup mechanism this page’s protection builds on
  • getting-started/installation — first-time setup, not an upgrade