OpenClaw State Backup
name: openclaw-state-backup
by danielwangyy · published 2026-03-22
$ claw add gh:danielwangyy/danielwangyy-openclaw-state-backup---
name: openclaw-state-backup
version: 1.0.2
description: Create, inspect, and restore versioned OpenClaw state backups with rollback safety. Use when backing up or migrating OpenClaw memory, workspace state, gateway config, cron/session state, or when restoring a previously captured snapshot after breakage, config mistakes, host migration, or context-loss concerns.
---
# OpenClaw State Backup
Create and restore **versioned, restorable snapshots** of mutable OpenClaw state.
What changes over time
Treat these as **mutable state** and include them in backups when they exist:
Treat these as **mostly static/user-maintained bootstrap files** and back them up when you want a full environment restore, but do not rely on them as fast-changing runtime state:
Backup strategy
Use the bundled scripts for deterministic behavior.
Create backup
Run `scripts/backup_state.py` with:
`mutable` captures changing state only.
`full` adds mostly-static workspace identity/bootstrap files too.
The script writes:
Restore backup
Run `scripts/restore_state.py` with:
Restore behavior:
1. verify archive structure + checksums
2. compare compatibility metadata
3. optionally narrow restore scope with include/exclude prefixes
4. build a restore plan (`create` / `update` / `unchanged` / `missingFromArchive`)
5. always write a JSON restore/dry-run report to disk
6. if `--dry-run`, stop after writing the diff-style report
7. otherwise create a **pre-restore rollback backup** automatically
8. restore files into place
9. write a final restore report showing what changed and where rollback lives
Safety rules
File model
The scripts split backup contents into:
Read the manifest if you need to inspect contents without restoring.
When to use which mode
Recovery guidance
If a restore causes problems, immediately restore the auto-generated **pre-restore rollback archive** created by `restore_state.py`.
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...