OpenClaw now has a supported path for compact, independently verifiable SQLite database snapshots. A late Sunday merge adds openclaw backup sqlite create, list, verify, and restore, giving operators a safer alternative to copying live database files and WAL sidecars by hand.
The pull request, feat(backup): add verified SQLite snapshots, focuses on database-scoped recovery. It is not a full backup service, upload scheduler, or retention system. It is a narrower primitive for capturing one OpenClaw SQLite database into a snapshot that can be synced, checked, and restored into a fresh file.
Source: OpenClaw PR #105718
What Changed
The new commands are backed by a strict local snapshot repository. Snapshot creation validates the source database, uses SQLite VACUUM INTO to capture committed WAL state into a compact file, verifies the result, hashes and manifests the artifact, and only publishes a fully synced snapshot directory.
Verification and restore also avoid trusting paths too early. The PR says OpenClaw re-copies content into private pinned staging paths before SQLite opens it, and restore refuses to write over an existing target.
The repository fails closed on a long list of unsafe conditions, including:
- Schema, index, ownership, and ACL violations.
- Path identity mismatches and publication races.
- Manifest or hash failures.
- Unexpected entries, hardlinks, and symlinks.
- Unsupported database roles.
- Stale sidecars and incomplete publications.
The implementation includes platform-specific care as well. Windows uses protected DACL directory creation, macOS validates ACL captures, and POSIX paths require private ownership and modes.
Why It Matters
OpenClaw's state is increasingly important. Agents, sessions, approvals, schedules, and channel metadata all depend on local persistence. When operators move hosts, replace containers, prepare failover, or respond to an incident, a sloppy database copy can create exactly the kind of partial state that is hardest to debug later.
Verified SQLite snapshots give administrators a smaller, checkable recovery unit. That is especially useful for self-hosted OpenClaw installs where the operator may not have a heavyweight backup platform but still needs confidence that a database artifact is complete before relying on it.
The restraint is also notable. This PR does not pretend to solve every backup workflow. Scheduling, uploads, retention, incremental WAL bundles, and in-place live replacement remain out of scope. Instead, OpenClaw gains a clean command surface for one concrete job: create, inspect, verify, and restore a database snapshot safely.
Verification
The PR reports a production build, changed-check pass, focused hosted Linux coverage, native Windows 11 ARM64 coverage, native macOS coverage, and fresh structured autoreview with no actionable findings. Tests covered repository rules, snapshot primitives, command behavior, protected Windows directories, ACL validation, non-ASCII paths, WAL capture, and restore flows.
For operators, this is a practical reliability upgrade. OpenClaw now has a first-party way to make SQLite state portable without turning backup day into a file-copy gamble.