SSyncropel Docs

Portability

Move records, threads and workspace pairings between Syncropel workspaces. Export from one workspace and import into another without losing data.

What this is

spl export produces a signed bundle of one workspace's data. spl import loads that bundle into another workspace. After an export and import, every record, thread, workspace pairing and consent grant is present on the new side, unchanged.

This is why hosted and self-hosted workspaces are equivalent: you can move a workspace between machines, between hosting providers, or between hosted and self-hosted, without losing data or relationships.

What's portable

Everything that's part of your workspace:

  • Records: every record on every thread. Importing the same bundle again changes nothing.
  • Threads: rebuilt from the records on import.
  • Workspace pairings: the lasting relationships you set up with spl federation pair. Addresses refresh on first contact after the move; you don't need to re-pair.
  • Consent grants: cross-namespace permissions, kept on the th_consent thread.
  • Identity: the workspace's identity can travel in the bundle (optional, see below). An import does not install it, though. The imported workspace keeps its own identity until you bring the original back with spl backup --auto restore-keys or an identity sidecar file.
  • Service accounts and adapters: your configured accounts and adapters.
  • Settings: routing rules, summary rules, decision policies and permission rules.

What's not in the bundle:

  • Plaintext secret values. Secrets live in your secret backend (env vars, vault, OS keyring). The bundle holds only references to them. To complete the migration, bring up the same secret backend on the new workspace separately.
  • Sign-in credentials: by default the bundle leaves out the records that make a bearer token work, and a workspace that imports a bundle drops any such records it finds unless you tell it to keep them. Pass --carry-tokens on export, and accept them on import, only if you intend to preserve them across the migration.
  • Trust scores: these are rebuilt automatically from the imported records.

An export made with an older version of Syncropel may contain your working credentials. Treat any older copy on disk as a secret: store it as you would a password, and if one has left your machine, rotate the tokens of the workspace it came from with spl token rotate. spl doctor names any such copy it finds in the workspace's own folders.

Export

The minimal command:

spl export --out /tmp/my-instance.tar.zst

This produces a tar.zst bundle signed by your workspace's identity. The signature ties the bundle to the workspace that made it: a bundle that was changed won't verify on import.

Useful flags:

FlagWhat it does
--out PATHBundle output path (required)
--uncompressedPlain .tar instead of .tar.zst (inspectable; larger)
--no-identityLeave out the private key and DID document. The bundle still imports; the importing workspace creates a new identity instead of adopting this one
--carry-tokensKeep service-account tokens valid across migration
--offlineRead the workspace files directly, with no running workspace (below)

When the workspace will not start

spl export normally asks the running workspace for the bundle. A workspace that cannot start (too little memory, damaged files, a machine that will not come up) cannot answer, and that is when your records are hardest to get out. --offline reads the workspace files directly, signs the bundle with the workspace's own keys, and needs no running workspace:

spl export --offline --out /tmp/my-instance.tar.zst

It refuses, and writes nothing, while the workspace is running. A PID file, an answering port, or an active spl-serve.service unit all count as running, and so does a workspace that is still starting (a large one can take up to a minute and a half). Stop the workspace first, or export without --offline. If a crash left a stale PID file, confirm nothing is running, remove run/spl.pid in the workspace's home folder, and export.

The bundle is the same as a normal export and imports the same way. You need free space for one copy of the workspace.

Inspect a bundle without unpacking:

tar --zstd -tf /tmp/my-instance.tar.zst | head
# manifest.json
# manifest.sig
# identity/did_document.json
# identity/private_key.bin
# records/<thread_id>/<record_id>.json
# ...

The manifest.json carries:

  • bundle_version: the bundle format version
  • source_did: the identity of the workspace that made the bundle
  • record_count: total records
  • bundle_sha256: a checksum over the bundle's files

Import

Importing into a fresh workspace:

spl import /tmp/my-instance.tar.zst

Importing into a workspace that already holds records (see the safety section below):

spl import /tmp/my-instance.tar.zst --force-overwrite

Useful flags:

FlagWhat it does
--dry-runChecks the bundle and reports counts without importing anything.
--force-overwriteAllow importing into a workspace that already holds records.
-o jsonMachine-readable output.

Safety: refusing to clobber

By default spl import refuses to import into a workspace that already holds records. This stops you from accidentally overwriting work with a snapshot from somewhere else.

To override:

spl import bundle.tar.zst --force-overwrite

Use this flag deliberately. Importing the same bundle twice never creates duplicates, so the usual flow is:

  1. Import once into a fresh workspace (no --force-overwrite needed).
  2. Re-import later if you want to check it. Nothing new is added (records_inserted: 0, records_deduplicated: 100).

Migrating between workspaces

A common move is from hosted to local. Say you have been using a hosted workspace and want to move to your laptop:

# On the hosted side
spl export --out ~/migration.tar.zst

# Locally
spl serve
spl identity generate
spl import ~/migration.tar.zst

After import, your pairings still point at the hosted address. The first time you spl sync from a paired peer, your workspace notices the address is out of date, looks up the peer's new address, updates it, and carries on. You don't need to re-pair.

The reverse migration (local → hosted) works the same way.

What an export and import preserves

You can export any workspace and import it into a fresh one with no differences in:

  • Records and their IDs
  • Threads
  • Workspace pairings
  • Consent grants

You can leave any time and take your records with you.

Troubleshooting

bundle malformed: identity/did_document.json has no Ed25519VerificationKey2020: The bundle's identity file can't be read. Either the bundle came from an incompatible version, or it is corrupted. Re-export.

import refused: local store has N records; pass --force-overwrite to import anyway: Safety check. Either start with a fresh workspace, or pass --force-overwrite if you mean it.

signature verification failed: The bundle's signature doesn't match its identity. The bundle was changed or is corrupted. Re-export from a trusted source.

identity-family record failed verification on import: DID missing expected method prefix: <missing master_did>: The bundle was made by an older version of Syncropel from a workspace that had retired an assistant. Update Syncropel, then re-export and import again.

Reading the import summary. records_inspected equals records_inserted plus records_deduplicated (already there) plus records_skipped (a record already held under a different ID, which a fresh workspace's own starting configuration can cause) plus records_failed. refusals_by_reason names each reason. identity_restored says whether the bundle's identity was installed into the target workspace; when the bundle carried one and it was not, identity_note says so and names the paths that do bring an identity back (spl backup --auto restore-keys, spl repo restore --identity-sidecar). A restore of records without the identity boots as a different workspace.

A pairing shows an old address after import: Expected. The address refreshes on first contact. If the peer is unreachable at the old address and its new address can't be found, sync reports a clear error pointing you at spl federation refresh <peer-did>.

See also

On this page