Connect backup. Know the recovery path.
Cloud backup stores encrypted database data on a relay. A recovery phrase restores the default database and can restore owned databases into a new home.
Source reviewed 3 December 2026: 5eb6a3a63. For your installed release, run lastdb --help and lastdb --version.
LastDB controls data recovery.
LastDB Cloud is the backup and sharing service built into LastDB. It stores and carries encrypted data. LastDB owns record rules, recovery correctness, and cleanup decisions. This uses a central relay, not a peer-to-peer network. A record replacement supplies the whole record. For directly permitted writes, local success follows the disk commit; it does not mean cloud upload has finished.
Cloud backup is optional for local use. The recovery phrase restores the default database and derives read keys for databases this node owns. You can display the phrase again in a terminal with lastdb identity recovery-phrase; confirm the prompt, or pass --yes in a terminal. Keep it secure and never put it in chat, shell history, logs, or source files.
Connect this node to LastDB Cloud.
Check lastdb cloud --help on your Mac. On older releases, use lastdb backup for the connect, snapshot, and restore commands below.
lastdb cloud connect --env prod
A first connection defaults to production when you omit the environment; existing connections require --env or LASTDB_ENV. The command uses the node identity already in this home, saves cloud credentials locally, and wakes cloud sync. Production cloud writes require the paid service. See cloud pricing and setup. The command does not print the API key. If its result says restart_required: true, restart LastDB with its service manager, then check lastdb status. To use an existing account key or a different environment, read lastdb cloud connect --help first.
lastdb status
lastdb status shows the cloud sync connection and the relay's reported state. A connected account does not by itself prove that a recent snapshot is present.
The cloud service holds and relays encrypted bytes. Local writes may be durable before the cloud has received them.
Request and wait for a database snapshot.
lastdb cloud snapshot --wait
This example requests a snapshot of the default database and waits for the relay acknowledgment. Snapshot commands can select another registered database with --database and its ID or name, subject to this node’s permissions. The command may wait up to 30 minutes. Its report describes that request; check lastdb status for current cloud state. This command does not create an independent offline copy.
Restore into a path that does not exist.
On a new Mac
Install LastDB. You need your recovery phrase. Save it before losing access to the original Mac. This example selects production explicitly. Use --env dev for the dev relay or --relay-url for a custom relay. Enter the phrase when prompted. It stays hidden. No files from the original Mac are needed for the default database.
( set -e printf 'Recovery phrase: ' >&2 read -rs PHRASE printf '\n' >&2 printf '%s' "$PHRASE" | lastdb backup restore --recovery-phrase-stdin --env prod --into "$HOME/.lastdb-recovered" --json )
On the original Mac
Keep the existing home intact. The command below reads the recovery phrase without echo, uses the existing home only to find saved relay credentials, and writes a new home to a separate path. It always restores the default database.
read -s RECOVERY_PHRASE printf '\n' printf '%s' "$RECOVERY_PHRASE" | lastdb --data-dir "$HOME/.lastdb" cloud restore --recovery-phrase-stdin --into "$HOME/.lastdb-recovered" unset RECOVERY_PHRASE
Replace the destination with a new path that does not already exist. To restore an additional database that this node owns, add --database <64-hex-database-id>. Repeat that option for each additional database. The phrase derives the read key from each owned database ID. A received database uses a key supplied by its publisher’s link, so this command cannot restore it from the phrase alone. Use --env dev for the dev relay, or provide --relay-url for a custom relay. Without either, restore uses a saved relay URL from the original home when available, then defaults to production. The command reads the phrase from standard input. For every selected database, it installs the newest available signed snapshot, then replays later stream entries. If no snapshot exists, it reads available streams from their start.
The new registry uses each additional database ID as its name. The local name is not recovered. Signed grants are recovered with database history. A restored owner can create a share link for the default database or another owned database when its authority and cloud connection allow it. The link does not grant access; signed grants control member access. It also does not restore saved cloud credentials, installed apps, app registry state, the operating system, or unselected databases.
Review the restore report and confirm its destination, snapshot, and replay results before starting the recovered node.
Reconnect the recovered home to the production relay before starting its service:
lastdb --data-dir "$HOME/.lastdb-recovered" backup connect --env prod
After confirming the home and its connection settings, install its service with lastdb --data-dir "$HOME/.lastdb-recovered" service install. This service uses the default label com.edgevector.lastdbd; installation refuses if another job already owns that label. On the same Mac, switch to the recovered service only after stopping the old service through its manager. After the recovered node starts, read known important records from that home in batches. Reinstall apps and their grants as needed. Confirm the records you expect are present before retiring the old home. Keep both data homes until you decide which to retain.
Know the recovery boundaries.
- A restore needs the correct recovery phrase and relay access. The phrase cannot be reconstructed if lost.
- The default database is always restored. Additional databases require their IDs and must use keys derived from this node’s seed; a received database’s link key is not derived from the phrase.
- Restore does not recover saved cloud credentials, database names, installed apps, app registry state, the operating system, or unselected databases.
- The default database can be shared. Signed grants control access, and the publisher decides member proposals; see sharing.
- Cloud backup is not an independent offline copy. Do not treat a successful cloud connection as proof that every recent write has reached the relay; check
lastdb status.
Choose another task.
Install
Start your database and choose an optional app.
Use LastDB
Use Brain, LastSecrets, and MCP.
Upgrade
Check, update, roll back, or adopt a managed service.
Node health
Check the socket and service before changing anything.