OpenClaw backup and restore
What the backup command captures, the three formats, and when to run it
OpenClaw has a first-class backup command with three formats: a verified archive of the whole state, compact snapshots of one SQLite database, and versioned database history in a Git repository you own, with a scheduler that can run it every day and push. Most people find it the day after they needed it. Here is what each format captures, how restore works, and the two moments to run it.
The archive
- One create command writes a timestamped archive of state, config, auth profiles, channel and provider credentials, sessions and, by default, the workspaces; a flag excludes the workspace, another backs up only the config file.
- The archive embeds a manifest with the resolved source paths; existing archives are never overwritten, and an output path inside the state tree is rejected so a backup cannot include itself.
- Verify checks that the archive has exactly one manifest, rejects traversal paths and unsafe links, and confirms every declared payload.
- Restore unpacks into a fresh staging directory without touching the live state, so you decide what to move back.
Two caveats the docs spell out. The config-only flag backs up the active config file but not the files it includes, so it is a root-file export rather than a complete recovery point. And the archive is not one atomic snapshot across config and every database: config files are pinned before database capture, and each SQLite snapshot keeps its own consistency.
Existing archive files are never overwritten.
SQLite snapshots and Git history
For one database, a snapshot command creates, lists, verifies and restores compact copies, globally or per agent. For history, a Git backup can be initialised against a private remote, created for all databases and pushed, logged, verified and restored per agent; the enable command schedules it, every twenty-four hours for example, with a push. That is the format for people who want to know what changed and when, not just that a copy exists.
The two moments
- Before an update: the rollback path assumes you still have the previous state, and a full archive is the cheapest way to have it.
- Before an uninstall or a reset: the docs recommend previewing which paths would be included, and the uninstall guide says to move the workspace out before any manual deletion.
Updating OpenClaw and How to uninstall OpenClaw are the two guides where the backup command is the first step rather than the last.
If you only back up one thing
The workspace: the memory files, the skills you wrote and the agent’s instructions are the part that took months to accumulate and cannot be reinstalled. how OpenClaw memory works explains why those files are the assistant.
On Diali
On Diali the Backups add-on takes a daily snapshot with thirty days of history, offers on-demand backups and one-click restore from the dashboard, and is included on the Max plan. The workspace is what it protects, for the same reason. Hosted OpenClaw on Diali is the assistant; Diali pricing has the add-on.
- An archive for everything, a snapshot for one database, Git for history.
- Never overwritten, verified, restored into staging.
- Back up before you update and before you uninstall.
Stop reading about it, build one
Set up an agent, pick a channel, and have it working inside the app you already keep open.
