rt state restore
rt › state › restore
Restore state.db from a local copy or from encrypted backup (--from-backup). Refuses while the daemon is running unless --force.
Usage
rt state restore <copy> [flags]
Arguments & flags
| Flag / Arg | Type | Default | Description |
|---|---|---|---|
<copy> | text | Backup filename (under rt state's backups dir) or an absolute path | |
--force | boolean | false | Override the running-daemon refusal (state.db is shared and WAL-mode; stop the daemon instead when possible) |
--json | boolean | false | Print the outcome as JSON |
--from-backup | boolean | false | Restore from the encrypted backup in the home repo instead of a local stamped copy |
--only | text | Restore only this app's backup (rt, board, gitq) | |
--at | text | Restore the backup at this timestamp instead of the latest | |
--identity | text | Path to an age identity file (team key restore on a new machine with no keychain key yet) | |
--dry-run | boolean | false | Show what --from-backup would restore without changing anything |
See code: commands/state.ts › stateRestore
Examples & notes
Restores state databases from a local stamped copy or from the encrypted backup in the home repo.
# From encrypted backup (most common)
rt state restore --from-backup
# Restore only one app
rt state restore --from-backup --only rt
# Point-in-time restore
rt state restore --from-backup --at 2026-09-10
# New machine with no keychain key
rt state restore --from-backup --identity ~/team-key.txt
# Preview without writing
rt state restore --from-backup --dry-run
# From a local stamped copy
rt state restore state-2026-09-13T12-00-00.db
The daemon must be stopped before restoring. The command refuses otherwise unless --force is passed.
See the State backup guide for the full restore flow.