Skip to content

Upgrading

Inboxora docs edited this page Oct 8, 2026 · 12 revisions

Upgrading

Inboxora runs its database migrations automatically when the backend starts. An upgrade is therefore: back up, change the version, pull, recreate.

Always back up PostgreSQL and .env first. ENCRYPTION_KEY is not stored in the database; restoring a database backup without the matching key leaves every stored credential unreadable.

Coming from MailFlow rather than an earlier Inboxora? Use Migrating from MailFlow instead.

Upgrading 4.0.3 to 4.0.4 needs nothing beyond the standard steps. 4.0.4 is a desktop-app release: no migration, no new environment variable, no API or configuration change, and the web/PWA and Android builds behave exactly as in 4.0.3. Only the Electron build gains the new title bar, notification settings and Windows default-app support. See Release notes 4.0.4.

Upgrading 4.0.2 to 4.0.3 needs nothing beyond the standard steps. 4.0.3 is a reliability release: database migrations 0094–0100 are applied automatically when the backend starts, no new environment variable is required, and antispam auto-move stays opt-in per account. See Release notes 4.0.3.

Upgrading 4.0.0 to 4.0.1 needs nothing beyond the standard steps. 4.0.1 is the TypeScript rewrite of the codebase: no schema migration, no new environment variable and no interface change. See Release notes 4.0.1.

Standard upgrade

Run these commands from the directory containing your current Compose file and .env. Use the database identity from the running backend, not the default in a newly downloaded Compose file. A deployment migrated from MailFlow may still use mailflow.

set -e
umask 077
DB_USER=$(docker compose exec -T backend printenv DB_USER)
DB_NAME=$(docker compose exec -T backend printenv DB_NAME)
BACKUP="inboxora-$(date +%Y%m%d-%H%M%S).dump"
docker compose exec -T postgres pg_dump -U "$DB_USER" -d "$DB_NAME" -Fc > "$BACKUP"
test -s "$BACKUP"
docker compose exec -T postgres pg_restore --list < "$BACKUP" > /dev/null
cp .env .env.backup

A readable archive is a basic check, not a substitute for testing a restore. Keep the backup and matching .env securely outside the database volume. Then set INBOXORA_VERSION=4.3.3 in the existing .env when using the supplied GHCR Compose file. A custom Compose may instead use VERSION_TAG; change the variable it actually references. Do not overwrite secrets, rename the database or recreate its volume.

docker compose pull backend frontend
docker compose up -d --no-deps backend frontend
docker compose ps
docker compose logs --tail=100 backend

Replace all backend replicas together. Allow startup migrations to finish before directing users to the new application, then check its health through the configured public URL.

Upgrading to 4.3.3

From 4.3.2, use the standard upgrade steps and deploy matching backend and frontend 4.3.3 images or install the updated Android app. There is no new database migration, environment variable or provider permission in this release.

This hotfix restores system status bar and display cutout spacing on Android 15+ edge-to-edge screens and mobile WebViews, and falls back CSS safe-area variables to Capacitor-injected custom properties.

Android 4.3.3 uses versionCode 4030300. Desktop and Android packages are attached to the GitHub release after their signed build workflow completes. See Release notes 4.3.3.

Upgrading to 4.3.2

From 4.3.1, use the standard upgrade steps and deploy matching backend and frontend 4.3.2 images. Normal startup automatically applies 0169:

  • 0169_deduplicate_conversation_ingest_failures.sql resolves historical ingest failure records for messages already ingested, resolves redundant duplicate active failure entries, and adds a partial index idx_conversation_ingest_failures_unresolved_lookup for active failure lookups.

This patch stops retry queue bloat in conversation_ingest_failures by deduplicating active failure records with exponential backoff, auto-resolving failures upon successful ingest and retry, and pruning dead retries during operational maintenance (#16). It also clarifies storage maintenance delta metrics.

Android 4.3.2 uses versionCode 4030200. Desktop and Android packages are attached to the GitHub release after their signed build workflow completes. See Release notes 4.3.2.

Upgrading to 4.3.1

From 4.3.0, use the standard upgrade steps and deploy matching backend and frontend 4.3.1 images. There is no new database migration, environment variable or provider permission in this patch; the schema remains at migration 0168_alias_default_recipients.sql.

The main user-visible correction is thread-list presentation: when a provider exposes the same logical mail through multiple physical folders, the expanded list shows it once. Inboxora still keeps each physical copy for provider synchronization and read/star/move/archive actions.

Android 4.3.1 uses versionCode 4030100. Desktop and Android packages are attached to the GitHub release after their signed build workflow completes. See Release notes 4.3.1.

Upgrading to 4.3.0

From 4.2.0, normal startup applies 0167 and 0168 in filename order.

  • 0167_mcp_authorization.sql adds isolated MCP OAuth/client/grant/token and durable operation state. It does not reset mail, calendar or contact data. The MCP endpoint remains disabled unless MCP_ENABLED=true.
  • 0168_alias_default_recipients.sql adds nullable alias-level default CC/BCC overrides. NULL means inherit the account value; an explicit array, including an empty one, overrides it.

Deploy matching backend and frontend 4.3.0 images together. Existing provider consent is not replaced, and no mailbox/calendar/address-book recreation is required.

If enabling MCP, verify the public APP_URL, HTTPS termination and forwarded scheme before issuing tokens. The supplied proxy accepts MCP credentials on its internal HTTP hop only when the trusted TLS proxy sends X-Forwarded-Proto: https. Keep MCP_ENABLED false if external AI access is not needed. See External AI applications (MCP).

The Docker backend now contains the document-preview runtime and its pinned native/Python dependencies. Optional ClamAV is a separate private service; enabling it is not required for 4.3.0. Review Release notes 4.3.0 for supported preview formats, resource limits and signature-trust behavior.

Android 4.3.0 uses versionCode 4030000. Desktop and Android packages are attached to the GitHub release after their signed build workflow completes.

Upgrading to 4.2.0

From 4.1.2, normal startup applies 0150 through 0166 in filename order, with no 0157 file. The complete list and purpose of each file are in Release notes 4.2.0. This includes sender and recipient defaults, the durable sending/flag queues, collection lifecycle, DAV account associations and invitation aliases. Older installations first apply the intervening chain. Already-applied matching migrations are not repeated.

0165 builds the account/UUID header-repair index concurrently. An interrupted attempt can be retried by the normal runner; do not remove unrelated indexes or reset checksums. 0166 clears only the exact false Host must be a string legacy status on native Gmail/Graph accounts, without erasing genuine provider or IMAP errors. Refresh the account list after upgrade. Account recreation or renewed provider consent is not required for these fixes.

Use the supported PostgreSQL 16 stack and matching backend/frontend images. Source builds use Node 22; Nodemailer 10 requires at least Node 20. No new environment setting or blanket provider permission is required. Keep existing prefetch/retention settings and account identities. New accounts start with empty default CC/BCC; Undo Send stays off unless enabled.

Inspect ongoing storage repair without changing data:

docker compose exec -T backend node dist/scripts/storageMaintenanceStatus.js --summary

Wait for initial_sweep: complete before comparing the report's before/current database sizes. header_scan_rows can grow while headers_repaired remains constant; the worker may be inspecting already-correct rows. Use the full report for failure stage and retry deadline. PostgreSQL can reuse freed space without reducing file size. No automatic VACUUM FULL or mailbox reset is part of this upgrade.

Check Scheduled for pending or uncertain deliveries before and after maintenance. An uncertain outcome is not automatically sent again: inspect the provider's Sent folder before any deliberate retry. Rollback means restoring a matching application/database backup; an older image is not guaranteed to understand new queue states or the migrated schema.

Earlier release-specific guidance is retained below for installations upgrading from those versions. Historical feature descriptions are not the current feature list; see Archive.

Upgrading to 4.1.2

4.1.2 includes database and maintenance changes. Back up PostgreSQL and .env first, then upgrade all backend instances together. The normal startup runner applies, in order, 0146_bounded_dav_sync_storage.sql, 0147_mail_prefetch_backoff.sql, 0148_graph_reader_body_completeness.sql and 0149_body_cache_retention.sql. Do not run an older backend against the post-0146 compact DAV journal schema; restore the pre-upgrade backup for a full rollback.

After startup, storage repair runs automatically in bounded resumable batches. Existing DAV clients whose sync token predates the compacted history can be asked for one full sync; this does not delete calendar events or contacts. No provider reconnect or mailbox resync is required.

Administrators should review Settings → Administration → Performance after upgrade. The defaults are safe for a normal installation: 25 visible message bodies prefetched, 30-day body cache/DAV history, 10,000 DAV entries per collection, 90-day authentication logs, 30-day conversation audit, and 7-day resolved-ingest/outbox-payload history. See Configuration and Release notes 4.1.2.

Upgrading to 4.1.0

4.1.0 adds the native provider layer. Nothing about an existing installation stops working, and nothing is migrated, deleted or rewritten on its own.

Migrations. Apply the complete post-4.0.4 chain 0101_provider_layer.sql through 0140_gmail_legacy_charset_cache_refresh.sql before rolling out the application. The migration runner sorts full filenames lexically, so both 0118_carddav_source_identity.sql and 0118_immutable_message_ids.sql are applied in that order; do not renumber or skip either file. The chain is additive and an interrupted run is resumable. Apply 0110 before device authorization, 0111 before the Gmail API adapter, 0112 before collection write-back, 0113 before enabling provider push, 0139_conversation_raw_header_dedup.sql before the updated Conversation Engine, and 0140_gmail_legacy_charset_cache_refresh.sql before the updated Gmail reader. The older 4.0.4 code ignores the new columns, so a rollback remains possible after a backup.

No manual SQL is required, including for the one migration that needed a correction. 0108 created a unique index on messages (account_id, provider_message_id) while assuming that column had always been the native provider identity. On a Gmail IMAP mailbox it is X-GM-MSGID instead, which is mailbox-wide: the same message legitimately carries the same value in every folder/label copy (INBOX, [Gmail]/Important, [Gmail]/All Mail, custom labels), so a real mailbox with duplicate values failed the index with 23505 and the backend stopped at that migration. The corrected 0108 clears that column for the accounts whose own transport is the legacy one (mail_transport NULL or imap_smtp) before creating the index and leaves it alone for native accounts. No row is deleted, and uid, folder, message_id, thread_key, provider_thread_id (X-GM-THRID) and every Conversation Engine value are preserved, so conversations, rules, snoozes and Gmail threading are unaffected.

Upgrade from 4.0.4 databases containing legacy Gmail IMAP folder copies is covered by an integration test (backend/src/services/upgradeFrom404.integration.test.ts), which builds the historical schema with the production migration runner, seeds that exact duplicate-copy shape, and then upgrades it the way the backend does at start-up. A dev database that already applied the first revision of 0108 keeps booting: its recorded checksum is accepted rather than treated as a mismatch, and 0114 then performs the same normalisation unconditionally, so a leftover legacy provider id cannot collide with the index during a later IMAP copy or a new Gmail label. Nothing is required from the operator in any of these states.

What changes without you doing anything

Area After the upgrade
Mail Unchanged transports. An account with mail_transport unset or imap_smtp keeps using IMAP/SMTP exactly as before.
Google accounts Unchanged. The app-password path keeps working and is a supported long-term choice; if the API is configured, the accounts settings show a recommendation you may Ignore or dismiss with do not show again (durable, per user and per mailbox). Nothing migrates on its own.
Microsoft accounts Unchanged until you authorize a connection. Once the Graph connection exists you can migrate the account in place: the same account row, no duplicate, no local data copied or lost, and no IMAP/SMTP fallback afterwards.
Imported collections Still read-only, now with a per-collection write-back switch where the source allows it.
DAV The endpoints are unchanged. An external CalDAV/CardDAV collection becomes writable back to its server once you enable write-back for it — its link is created on the next sync of that source.
Send limits MAIL_MAX_MESSAGE_BYTES is now the fallback ceiling for SMTP only, and the new MAIL_MAX_ATTACHMENT_BYTES is the hard installation ceiling. A Microsoft Graph account is no longer bounded by the SMTP-era 25 MB total.

Migration 0139 and 0140. Apply 0139_conversation_raw_header_dedup.sql after 0138_calendar_color_overrides.sql, then 0140_gmail_legacy_charset_cache_refresh.sql, before serving the new Conversation Engine/Gmail reader code. Migration 0139 clears redundant nullable logical_messages.raw_headers payloads while retaining the column; physical messages.conversation_raw_headers remains intact. Migration 0140 only marks cached Gmail API reader bodies incomplete so they refresh on demand and are not deleted. Run the documented DB-CHECKS.sql queries on a staging copy before and after 0139. Ordinary VACUUM (ANALYZE) may reclaim dead space for reuse; returning relation files to the OS requires a separately scheduled VACUUM FULL or pg_repack maintenance window and is never run automatically.

Recommended post-upgrade steps

  1. Apply the migrations and start the new version; confirm folders, mail and DAV still work.
  2. Configure a provider as Connecting Google and Microsoft accounts describes, if you intend to use the APIs.
  3. For each Microsoft account you want on Graph: connect the Graph authorization (browser or device code), then migrate the account from the accounts settings.
  4. Decide write-back per collection: leave pulled collections read-only unless you want edits forwarded to the source.
  5. If your server or reverse proxy bounds request bodies, review MAIL_MAX_ATTACHMENT_BYTES so the two agree.

Upgrading to 4.0.0

4.0.0 is a major release: it adds calendars, contacts, DAV and the conversation engine. Most of it is new surface rather than a change to existing behaviour, so an upgrade from 3.4.0 is straightforward — but note the following.

Before you upgrade

  • Back up the database and .env as above.
  • Note the current INBOXORA_VERSION so you can roll back the image if needed.
  • If you run a fork with local modifications, review docs/CHANGELOG.md for the full change list.

What to expect

Area After the upgrade
Existing preferences Kept. Theme, fonts, layout, panel widths and notification settings are not reset.
Mail Unchanged accounts and folders. Threading becomes available and is off by default; enable the threaded list and/or conversation reader in Settings → Appearance.
Conversation metadata Populated as mail syncs. Historical mail is grouped gradually; an administrator can run a rebuild per account.
Calendar New local calendars start empty. Add CalDAV or ICS sources to import existing ones.
Contacts New empty address books. Import a Google CSV, or connect a CardDAV account to pull existing contacts.
Google accounts Nothing is removed and nothing is forced. An existing mail account keeps working with its Google app password, and an administrator can optionally register a Google OAuth client to pull that account's contacts and calendars read-only. Connecting the API does not change the mail transport and does not ask for Gmail permissions.
Microsoft accounts Mail needs the API connection, because Outlook.com and Microsoft 365 no longer accept a mailbox password. An administrator registers one Azure application — with either the browser or the device-code method — and each user then authorizes their own account. Existing accounts and their local history stay in place; they simply cannot reach the mailbox until that authorization happens.
Imported collections Contacts and calendars pulled from a provider are read-only here until write-back is enabled for a collection (4.1 adds that per-collection switch): the provider is their writer, so an edit made before enabling it is refused rather than silently undone at the next refresh.
DAV CardDAV and CalDAV endpoints become available. Existing devices need an application password from Settings → DAV access.
Docker stack A new ntfy service and a new ntfy_data volume are added for Android instant notifications. They are independent of PostgreSQL and Redis, so no mail, calendar or contact data is touched. Refresh the published docker-compose.yml from the release before pulling.
Notifications (Android) Set the ntfy app's Default server to https://<your-domain> — the origin, no /push path (the ntfy app rejects a base URL with a path). Inboxora proxies the UnifiedPush topic namespace at that origin. PWA Web Push is unchanged.
Bookmarks Unchanged. The phone layout and navigation drawer are the same shell as 3.4.

Recommended post-upgrade steps

  1. Refresh the compose file from the release, then docker compose pull && docker compose up -d. The new ntfy service must be healthy (docker compose ps ntfy) before Android notifications work.
  2. Sign in and confirm folders and unread counts.
  3. Open Settings → Appearance → Layout and decide whether to enable the threaded list and the conversation reader.
  4. Group the existing mail with Rebuild conversations, on the same screen. Start with the dry run (it is on by default) to see how much would change, then clear it and run again for real. Existing mail has no conversation until this runs; new mail is grouped as it syncs.
  5. Add contacts (import or CardDAV) and calendars (local, CalDAV or ICS).
  6. Create DAV application passwords for each device and re-add the account on the device.
  7. If a mailbox is still grouped oddly afterwards, review Threading diagnostics for the affected conversations and use the manual merge, split or lock actions.

If nothing is configured for a provider yet

The upgrade does not require a provider to be configured, and an installation may run with none. Mail over IMAP/SMTP keeps working for every account that uses a password, including Google with an app password.

When an administrator does configure one:

  1. register the application as Connecting Google and Microsoft accounts describes;
  2. save the client id (and secret, where the method needs one) on the provider card, and check that the card reports the method as ready;
  3. each user authorizes their own account from the same card — the administrator's configuration and the user's authorization are deliberately separate, and no account is created or changed by configuring the application.

About the provider notices

The Microsoft requirement is stated on the provider card whenever it is opened, and it deliberately has no dismissal: a requirement that can be permanently hidden is a requirement that gets lost. The Google recommendation appears in the accounts settings for a Gmail mailbox that could use the API, with Ignore (which the interface forgets) and do not show again (a durable, per-user, per-mailbox suppression stored on the server). An administrator can switch a provider or one of its methods off, which is enforced, and the whole provider layer can be switched off for an installation with PROVIDER_INTEGRATIONS_ENABLED=0.

If a migration is interrupted

The runner records applied files and their checksums. Most schema changes are additive, but some migrations also perform narrowly scoped data repairs. Concurrent index creation runs outside a transaction and can leave an invalid index after interruption. Do not edit applied files or assume every migration is a no-op on stored values.

Check for one before re-running:

SELECT indexrelid::regclass AS invalid_index FROM pg_index WHERE NOT indisvalid;

Investigate the reported index against the failed migration before changing anything. For migration 0165, retry normal startup: that migration owns its dedicated index and safely rebuilds it. Do not drop unrelated indexes. For an older migration without a retry path, the following is a maintenance example to use only after confirming the exact affected index:

DROP INDEX CONCURRENTLY <invalid_index>;
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f backend/migrations/<the interrupted file>.sql

The runner records each file it has applied with its checksum, so a re-run skips what is already applied and refuses rather than guessing if a file's content no longer matches its record (Migration checksum mismatch). Check which file was in flight before re-running rather than assuming: the interrupted one is the only file that should need to be applied by hand.

Do not re-run the whole chain by hand, and do not drop tables to "start clean": the schema is extended in place, and the rows it extends are what the application is serving.

Rollback

Images are pinned, so a rollback is an image change:

  1. Set INBOXORA_VERSION back to the previous version.
  2. docker compose pull && docker compose up -d.
  3. If the newer version applied migrations your older image does not understand, restore the database backup taken before the upgrade.

Do not delete the ntfy_data volume when rolling back: it only holds undelivered push events, and keeping it avoids re-registering devices. Do not revert database migrations by hand — restore the pre-upgrade backup instead.

Upgrading a MailFlow deployment

Inboxora began as a fork of MailFlow, and an existing MailFlow deployment can be moved over without losing data.

Only MailFlow 3.3.0 is supported as a migration source. Newer MailFlow versions have not been tested and the migration history is not compatible with them.

Migrating from MailFlow is the full procedure: what carries over, the in-place and dump-and-restore routes, the database and volume naming traps that make a migrated instance look empty, and how to group existing mail into conversations afterwards.

Two things to know before you start, both covered there in detail:

  • Keep your existing ENCRYPTION_KEY, DB_NAME and DB_USER, and bring the stack up from the directory that holds your volumes. Inboxora's published compose file uses inboxora as its database default, and a new database name on an existing volume means the backend cannot connect.
  • The image version variable was renamed: MAILFLOW_VERSION → INBOXORA_VERSION.

The retained legacy identifiers and the reasoning behind them are recorded in docs/technical-identifier-audit.md.

Versioning

Inboxora uses semantic versioning. Major versions signal new product areas or breaking configuration changes, minor versions add features, and patch versions fix defects. Every release is documented in docs/CHANGELOG.md and on the releases page.

Clone this wiki locally