Backup and storage
A tie deployment has two data sets:
- the triplestore — one
.tiefile per collection (plus_prevhistory); - the filehost — the content-addressed blob directory.
They can be backed up independently, but restore them together.
The simplest backup
# stop writes, or use a snapshot
tie dump --file triples.tsv
rsync -a ~/.local/share/tie/ backup/tie-db/
rsync -a /var/lib/tie/data/ backup/tie-data/tie dump is a TSV of every triple; tie restore is additive and idempotent.
The blob store is content-addressed, so a plain copy is valid: a blob is either
present or not, and its name is its hash.
Filesystem snapshots
On Btrfs, a read-only snapshot of the triplestore directory and the blob
directory is consistent enough for btrfs send:
btrfs subvolume snapshot -r /var/lib/tie /var/lib/tie-snap
btrfs send /var/lib/tie-snap | ssh backup btrfs receive /backupcontrib/backup/ has btrfs-send-backup.sh, rsync-backup.sh and
triplestore-db-backup.sh.
The reaper
The filehost can reap blobs that are no longer referenced. ReapInterval = "0"
disables it (the default in the test environment). If you enable it, make sure
the triplestore backup you keep still references what the blobs need.
Restore order
- Stop the services.
- Restore the blob directory.
- Restore the
.tiefile(s). - Start the triplestore, then the filehost.
tie verify --deepandtie verify --check-blobs.
The source note is
docs/filehost-storage-and-backup.md.