Skip to content

06. Imports & Exports

Nicolás Baier Quezada edited this page Jun 5, 2026 · 6 revisions

06. Imports & Exports

DIRD+ uses a single portable container format, .dird, to move data between installations. The full binary specification is in docs/dird-format.md.

The .dird format

  • A .dird file is a ZIP containing patient(s), sessions, images (as blobs), detections, segmentations, classifications, measurements and reports — everything needed to reconstruct the records.
  • Version 2.0 (current): encrypted. The container is wrapped with AES-256-GCM and an authenticated header. The key is derived from the export passphrase (separate from the application login password) with Argon2id.
  • Version 1.0.1 (legacy): plain ZIP, still importable for backwards compatibility.
  • Implementation: src/lib/export/ (DirdExporter, DirdImporter) and src/lib/export/dird-container.ts (header v2.0).

.dird files contain sensitive clinical data and are never committed to the repository (they are git-ignored).

Export levels

Level What it includes
Full patient One patient with all their sessions, images and reports
Single session One session of one patient
All data Every patient in the database

Import behaviour

  • ID remapping — record IDs are reassigned on import so they never collide with existing local IDs.
  • Collision detection — if an incoming session would overwrite an existing one, the user is asked to confirm.
  • Wrong passphrase — an encrypted .dird opened with the wrong passphrase fails gracefully (authenticated decryption rejects it); no partial data is written.

Relationship to backups

Because the migration from the legacy IndexedDB storage exports a .dird backup before touching anything, .dird is also the recommended manual backup format: export "All data" periodically and store the file securely.

Clone this wiki locally