title: OCFL Storage slug: ocfl-storage category: Preservation order: 50
OCFL Storage
Heratio can mirror your digital objects into an Oxford Common File Layout (OCFL) v1.1 storage root. OCFL is a preservation-grade format: every file is hash-addressed, every change is versioned, and any OCFL-aware tool (anywhere in the world) can read what Heratio writes.
When to use it
- A funder, national archive, or audit body asks for OCFL deposits.
- You want a tamper-evident, versioned copy of your digital masters
separate from the live
uploads/tree. - You're migrating to a new instance and want a portable, self-describing bundle per archival item.
How it works
-
Initialise the storage root once per deployment:
php artisan ocfl:initThis writes the OCFL v1.1 namaste declaration + layout descriptor into the configured disk (default:
storage/ocfl). -
Ingest an archival item any time you want a snapshot:
php artisan ocfl:ingest 12345The first call writes version
v1. Subsequent calls (after the item's digital content changes) writev2,v3, ... and reuse unchanged files across versions. -
Verify fixity on demand or on schedule:
php artisan ocfl:verify 12345 # one item php artisan ocfl:verify # the entire rootExits 0 if every digest matches, 1 if anything has drifted.
-
Export a portable bundle for handover or audit:
php artisan ocfl:export 12345Produces
storage/ocfl-exports/urn_heratio_io_12345.tar. The tar contains the full OCFL object - inventory, all versions, all content files.
What gets stored
- Every file referenced by
digital_objectrows for the information object. - A deterministic
inventory.jsonwith sha512 fixity for every file plus a sidecar hash of the inventory itself. - One namaste declaration per object (
0=ocfl_object_1.1).
Restoring from OCFL
If a live file is lost or damaged, use ocfl:verify to identify the bad
digest, ocfl:export to pull the OCFL object out, then unpack the tar
and copy the affected vN/content/<path> file back into the live
uploads/ tree.
Configuration
| Env var | Default | Notes |
|---|---|---|
OCFL_DISK |
ocfl |
Laravel filesystem disk to use |
OCFL_DIGEST_ALGORITHM |
sha512 |
Or sha256 |
OCFL_STORAGE_LAYOUT |
flat-id |
flat-id, pairtree, hashed-n-tuple |
OCFL_AUTO_INIT |
false |
Auto-run ocfl:init on first boot |
OCFL_EXPORT_PATH |
storage/ocfl-exports |
Where ocfl:export writes tarballs |
OCFL_CLI_USER_NAME |
cli |
Recorded in inventory.user.name for CLI/queue runs |