Skip to main content
Back up Quivr before upgrading and keep the previous configuration and plugin pins available until you’ve checked the new release. Reset is for environments whose contents you intend to erase.

Prerequisites

Read the new release notes for compatibility, required backfills and any deferred migrations. Keep both releases, their configuration and their plugin images available. An in-place upgrade needs a supported starting version. For an unsupported version, bring up a fresh installation and import the original content.

Back up the installation

Take a coordinated backup of PostgreSQL, object storage, the search index and the configuration, including secrets. Back up Temporal persistence as part of the same recovery point. Protect the backup and test restoring it before starting the upgrade. For the single-machine bundle, stop all services with docker compose --profile demo stop before taking host snapshots. Save the four named volumes (PostgreSQL, SeaweedFS, Weaviate and model cache) and keep .env, compose.yaml and release.json together. For a SQLite-backed Temporal bundle, also snapshot its <project>-temporal-data volume if present. Only Temporal’s new PostgreSQL databases start fresh. The existing Quivr database stays on the persistent PostgreSQL volume. Restore backups under the original project and volume names.

Upgrade a Compose bundle

Schedule downtime and drain active work before upgrading the bundle. The installer stops the API, worker and demo in place. If you are moving from a bundle that used SQLite for Temporal, the PostgreSQL-backed version creates new Temporal databases. Verify the new bundle’s image digests. Use the new bundle’s installer with the path to the existing installation and the new release manifest. For example:
The installer keeps the existing project settings, recreates the migrator and starts the stack. From the installation directory, run docker compose --profile demo up -d if you use the demo.

Roll the API and workers

Use this sequence for a deployment that can run overlapping instances. A rolling upgrade requires version and plugin compatibility throughout the overlap.
  1. Run the new migrator with QUIVR_CONFIG=/path/to/new-config.json quivr migrate, substituting the new deployment JSON path. It applies additive changes and prepares shared dependencies. If it times out on a database lock, let the conflicting work finish before retrying.
  2. Start the new workers. Wait for readiness. If the release notes identify work the new workers cannot resume, let the previous workers finish it. Then send SIGTERM to the previous workers and wait for them to drain and exit.
  3. Start the new API instances. Send traffic to each once its private /readyz returns HTTP 204, then drain the previous instances. A 204 can arrive while performance indexes are still building. If you need those indexes at handover, wait for X-Quivr-Index-Setup: ready before routing traffic.

Drain legacy ingestion before retiring workers

If the installation still has legacy Temporal work, keep a compatible worker serving both the live and bulk queues. This worker also polls quivr-content-v0. Keep it running until every active history on that legacy queue finishes. Before retiring the last compatible worker, also confirm that PostgreSQL has no rows with legacy_workflow = true in ingestion_outbox or ingestion_batches. Check the queue and tables on the old deployment before applying the contract migration that drops those columns. For supported starting versions, see Versions and compatibility.

Check it worked

Check the API and worker readiness probes, ingest a document, and confirm it appears in search. With the new deployment file selected in QUIVR_CONFIG, run quivr storage status to check the PostgreSQL schema. Use the index setup diagnostics if the schema or indexes are still pending.

Diagnose migration and index setup

  • migration_busy means another migrator held the lock. Let it finish before rerunning the new migrator.
  • Read X-Quivr-Index-Setup on the private /readyz response. ready means the process verified the expected indexes. Keep an API or worker running while setup is pending or retrying. The header reports index progress separately from HTTP readiness.
  • For index_setup_busy or index_setup_failed, check the structured setup logs. The live process retries and can repair matching invalid indexes. For index_definition_conflict, inspect the conflicting object in PostgreSQL and have the DBA rename it before retrying.
  • If the hot queue’s attempt primary key bloats, a DBA can run REINDEX INDEX CONCURRENTLY queue_document_attempts_pkey outside a transaction. Allow temporary disk space for the replacement index.
If a build repeatedly exceeds the 30-minute setup budget, drain and stop API and worker processes to pause automatic maintenance. In PostgreSQL, inspect the affected index’s indisvalid flag and pg_get_indexdef output. Drop a matching invalid index with DROP INDEX CONCURRENTLY outside a transaction. Leave a conflicting definition for the DBA to investigate. Recreate the matching index concurrently in a session with a longer statement timeout. For example, these are the definitions of two managed indexes:
Restart the API and workers and check the readiness header again.

Keep the rollback window

If both versions support the data written so far, application rollback can use the previous image, configuration and pins while leaving the additive changes in place. Rebuilding into a newer index format, enabling features that older writers can’t support, or applying destructive migrations can close this window. Recovery after an incompatible change requires a forward fix or restoring the coordinated backup. If the release calls for quivr migrate --contract, review every deferred change and confirm that the current application works both before and after those changes. Drain and stop every previous API and worker and wait for their in-flight work to finish before applying the contracts. The command applies all pending contracts and closes the application rollback window.

Initialize document totals

Keep corpus_stats.bootstrap_enabled at its default false until every previous API and worker has drained and stopped. If the release calls for initializing totals, set it to true and restart the current processes. Keep an enabled process running until the document totals report complete: true. Once initialization starts, only writers that maintain these totals can safely run.

Initialize queue observations

After an upgrade that changes queue totals, keep a current API or worker running while it initializes those totals in resumable pages. During a mixed-version rollout, counts can lag behind previous writers until reconciliation catches up. The queue endpoint returns HTTP 503 for missing or stale counts. Wait for observations to recover before using them to scale workers.

Enable parallel imports

For an upgrade from before the parallel journal was introduced, first run a version that supports both modes on all replicas. Drain and retire every writer that only supports legacy mode. Check quivr journal status, then run quivr journal activate --previous-writers-retired and confirm it reports parallel: true. Every binary in the rollback window must understand parallel mode. Once parallel mode is active, rolling back to a binary from before it was introduced is unsafe. To return to legacy numbering, retire every writer that predates the two-mode release and run quivr journal legacy --writers-drained. A timeout leaves the previous mode active. Keep publication row and sequence changes under this command. Manual changes, including calling setval, can race with live writers. Use quivr journal status to confirm the result. For a logical restore to a new PostgreSQL cluster, stop every Quivr API and worker before restoring. Keep them stopped until quivr journal restored --writers-drained succeeds against the restored database. Clients with expired snapshot cursors then restart from the catalog. See the journal command reference.

Reset a dedicated installation

Reset deletes stored content, workflows and index data. Confirm the target and backup before proceeding.
  • Release bundle. From its directory, check the project name in .env and review the services with docker compose --profile demo ps -a. To discard that bundle’s data and model cache, run docker compose --profile demo down --volumes. Run python3 setup.py prepare before starting it again. If a previous SQLite-backed Temporal bundle left an old volume behind, verify it is no longer needed and remove that exact volume separately. For example, substitute the project name from .env in docker volume rm "<project>-temporal-data".
  • Repository Compose or Railway deployment. Start from the matching installation declaration and fill in the identifiers for your dedicated environment. For example, run python3 deploy/reset.py -f /path/to/installation.json from the checkout to preview. After reviewing the scope, repeat it with --confirm --deployment-name "Example evaluation", replacing the quoted name with the exact declared deployment name.

Next