Backup and Restore

ADP stores durable application state in two SQLite databases: the vector index (.adp/index.sqlite3) and ingestion queue (.adp/jobs.sqlite3). Backups are local-first and require no cloud account or paid infrastructure.

Create a backup

Run the command while the API and worker are active or stopped. ADP uses SQLite’s online backup API, which captures committed database contents including committed WAL data without copying a live database file directly. Each database is individually consistent. Because the index and job queue are separate SQLite databases, the pair is not a single cross-database atomic snapshot; pause ingestion or stop the service when a coordinated point-in-time snapshot is required.

adp backup

# Explicit paths and destination
adp backup \
    --database .adp/index.sqlite3 \
    --jobs-database .adp/jobs.sqlite3 \
    --destination ./backups \
    --retention-count 7

The command includes whichever configured databases already exist and fails when neither exists. Each completed backup is written to a new directory with index.sqlite3 and/or jobs.sqlite3 plus a manifest.json containing the format version, creation time, byte sizes and SHA-256 checksums. SQLite quick_check is run on the source and backup. Files are created with owner-only permissions where supported, and a staging directory is atomically renamed only after the backup and manifest are complete.

The default retention policy keeps the seven newest completed backups in the destination. Set --retention-count 0 to disable automatic pruning. Only recognized ADP backup directories with readable manifests are eligible for pruning; unrelated files are left untouched. Store backups on a separate physical device or another trusted destination for protection against device loss. A backup on the same disk is not a disaster-recovery copy.

Restore into a new directory

Restore verifies the manifest, checksums, SQLite integrity and expected ADP tables before writing anything. The target directory must not already exist; ADP never overwrites an existing restore target.

adp restore ./backups/backup-20261130T120000Z-ab12cd34 \
    --target-dir ./recovered-adp-state

The restored files are named index.sqlite3 and jobs.sqlite3. Inspect the output, then configure the application to use these paths or copy them into the intended data directory while the application is stopped. Keep the original databases and backup untouched until the restored instance has passed health checks and representative search/job verification.

Recovery verification

After restore, start ADP against the restored databases and verify:

  • adp search returns expected indexed content using the same embedding configuration used when indexing.

  • The API readiness endpoint reports healthy when the service is running.

  • Previously queued and completed ingestion jobs are present in the job store.

  • Representative documents can be reprocessed and indexed successfully.

Limitations

  • Backups cover ADP’s SQLite index and job queue only. Original source documents, external embedding services, environment variables, API keys and monitoring volumes must be backed up separately.

  • Checksums detect accidental corruption but do not authenticate a backup against a malicious party able to replace both the data and manifest. Protect backup directories with filesystem permissions and trusted storage controls.

  • SQLite is intended here for a single-host deployment. Do not restore a live database over files used by a running process.