Backup and Recovery
Protect your Syncropel data, including the database, task content, and configuration.
This page is for people running their own workspace or using the API. If you use a workspace created at syncropel.com, start with Your hosted workspace.
What to Protect
| Data | Location | Contains |
|---|---|---|
| Database | ~/.syncro/hub.db | All records, trust, routing rules |
| Task content | ~/.syncro-data/tasks/ | Task descriptions and artifacts |
| Aliases | ~/.syncro-data/aliases.toml | Human-readable task alias mappings |
| Config | ~/.syncro/config.toml | Identity, store URL, server settings |
Automatic Backup
spl serve backs up the database every time it starts, into a folder for your instance:
~/.local/share/syncropel/backups/instance-<did-tail>/hub.db.bak<did-tail> is the last 24 characters of your instance DID. To find your folder:
curl -s localhost:9100/health | jq -r .instance_did
ls ~/.local/share/syncropel/backups/instance-<tail>/A daily backup also writes timestamped hub.db.<YYYYMMDD-HHMMSS> copies into the same folder. (An instance that has not set up its identity yet uses a folder named home-<hash>/ instead.)
The backup folder is outside ~/.syncro/, so removing that folder does not remove your backups.
Back up your identity too
A backup of hub.db alone saves your records but not your signing keys. The
keys are stored next to the database, not in it. If you restore without them,
you get a different workspace, and every signed-in request fails with
BOOTSTRAP_REQUIRED.
To include the keys, set SPL_BACKUP_PASSPHRASE in the environment of the
running server. The daily backup then seals the keys into the same backup set,
and spl backup --auto restore-keys brings them back. spl doctor and the
workspace status show identity covered or identity NOT covered, with the
reason. A workspace whose identity has never been backed up shows a warning even
when its backup is recent. The saved keys are only as recent as the last start
that ran a backup, so they can be older than your latest records.
Manual Backup
# Create a timestamped backup (use your instance directory from above)
cp ~/.syncro/hub.db ~/.local/share/syncropel/backups/instance-<tail>/hub.db.$(date +%Y%m%d-%H%M%S)
# List available backups across all instance directories
ls -la ~/.local/share/syncropel/backups/*/Recovery
# Stop the instance
spl stop
# Restore from backup
cp ~/.local/share/syncropel/backups/instance-<tail>/hub.db.bak ~/.syncro/hub.db
# Restart: trust and settings rebuild automatically from your records
spl serve
# Verify
spl status
spl task list
spl trustRestoring onto a new machine: the store first, then the keys
On a new machine, put the backed-up store in place first, then bring the keys back:
# 1. Put the store copy in place (with the daemon stopped)
cp <backup>/hub.db.<timestamp> ~/.syncro/hub.db
# 2. Then restore the keys from the same backup set
# (SPL_BACKUP_PASSPHRASE set to the backup's passphrase)
spl backup --auto restore-keys <backup>/keys.<timestamp>Use the keys.<timestamp> file whose timestamp matches the store copy you put in place, not the keys file with the newest date on disk. spl backup list shows which keys file goes with each store copy. A file's date isn't a guide: after a person is erased, older keys files that held their key are written again without it, and their dates change. With a keys file from another backup, records sealed between the two backups can't be read after the restore, and nothing warns you. It never brings back someone you erased.
Do it in this order. If you run restore-keys before the store is in place, the workspace signs with your
original keys but can report the new machine's workspace name on /health. If that happened, put the store
in place and run restore-keys again with --force.
A backup set also holds the workspace's order log (order.<timestamp>, beside keys.<timestamp>).
restore-keys puts it back for you. If you copy files by hand instead, copy order.<timestamp> too: a store
that held an order log and boots without one refuses to start (ORDER_LOG_MISSING) rather than quietly
beginning a new history. If the set really has none, start with SPL_ACCEPT_NO_ORDER_LOG=1: the new log's
first entry records the gap.
Portable backup: publish the workspace
The best portable backup is a published snapshot of the whole workspace:
spl repo publish <namespace>/<repo> --relocation--relocation is shorthand for --visibility L3 --scope instance --no-listing --carry-tokens. It saves the workspace as a portable copy that can be checked for integrity. To rebuild a working workspace from it on any machine:
# Client-side restore (with the daemon stopped)
spl repo restore <dir-or-https-url>
# Or build a fresh workspace from it when the server starts
spl serve --repo <locator>The startup .bak file protects against losing local files. The published copy is the one that moves between machines, and it checks its own integrity when you restore.
The newest records are checked
A restore checks every part of the copy, including the newest records saved after the last full snapshot (the "tail"). spl repo restore, spl repo mount and spl repo drift report the result as tail.status:
| Status | Meaning |
|---|---|
verified | The tail matched its checks, and its records were restored. |
refused | The tail failed a check. Nothing from the tail was restored; only the snapshot was. tail.reason says why and tail.not_taken says how many lines were left out. |
unverified | The copy came from an older version and has no tail check. You passed --accept-unverified-tail, so the lines were restored and the report says so. Without the flag, such a tail is refused. |
absent | The copy has no open tail. |
A tail that can't be verified is never restored, so the most recent records may be missing.
An older copy is refused unless you confirm
spl repo restore compares the copy with your live workspace before changing anything. If the copy is older, the restore stops and tells you both points in time, so an old copy can't quietly undo newer changes, such as a key you removed:
spl repo restore <locator> # refused: the live workspace is newer
spl repo restore <locator> --accept-older # proceed; the restore records that you chose thisThe same check runs for spl repo mount, spl move, spl backup restore-keys and spl import. The one exception is restoring keys from a daily backup set. Those keys are always older than the live workspace, and restoring them is normal recovery, so it is noted rather than refused. Anything you revoked or removed stays that way after a restore.
| Code | What it means |
|---|---|
LIVE_TREE_NEWER | The live workspace is newer than the copy. Nothing was restored. |
Your task notes are backed up too
Task notes (~/.syncro-data/) are part of the off-machine copy, and the startup backup writes
data.bak.tar.zst beside hub.db.bak. Restore them on their own with:
spl backup restore-data <backup-set> # adds what's missing; refuses a differing file
spl backup restore-data <backup-set> --replace # saves the current notes first, then replacesrestore-data never overwrites a note that differs from the backup unless you pass --replace, and then it
saves a copy under ~/.local/share/syncropel/backups/tasks/ first. spl repo restore and spl move bring
the notes into an empty data folder; otherwise they tell you the command to run.
| Code | What it means |
|---|---|
DATA_CONFLICT | A note in the backup differs from yours. Every conflict is listed and nothing was written. |
What rebuilds on startup
Everything else is rebuilt from your records when the server starts:
- Trust scores
- Settings
- Thread state
Prevention
- Use separate ports for development (
--port 9200) and production (port 9100) - Development instances use
--memoryfor ephemeral storage - Task content files in
~/.syncro-data/are independent of the database
Tiers and entitlements
Every run is limited by the tier of the person it runs for. How tiers set limits, how to change them, and how a subscription maps to a tier. A guide for people who run their own workspace.
Body-Kind Manifests
Speed up queries that filter on fields inside a record's body by declaring which fields to index for a given body.kind.