Backup & restore¶
LLMAIx Web keeps state in two places. Both must be backed up together to get a consistent restore point:
- The database (PostgreSQL in production) — projects, files metadata, documents, schemas, prompts, trials, results, evaluations, users, settings.
- Object / file storage — the actual uploaded files and generated artifacts, stored either in the local storage directory or an S3-compatible bucket under UUID-based filenames.
Keep the two in sync
The database references stored files by UUID. A database backup without the matching file storage (or vice versa) will restore to a broken state with dangling references. Snapshot both as close together as possible.
Database backup¶
For PostgreSQL:
Restore into an empty database:
File storage backup¶
- Local storage — back up the configured storage directory (e.g. with
tar,rsync, or a filesystem snapshot). - S3-compatible — enable bucket versioning and/or replicate the bucket
(
aws s3 sync, or your provider's backup tooling).
Restore procedure¶
- Stand up the app pointed at an empty database and storage location.
- Restore the file storage first.
- Restore the database from the matching dump.
- Start the backend — Alembic will confirm the schema matches the app version. Restore a dump only into the app version it was taken from (or newer, letting migrations run forward).
Retention¶
Align backup retention with your institution's data-retention policy and DPIA. Backups of clinical data are themselves in scope for information governance.