Backup and restore
Back up a graph to a compressed archive on the server and restore it as a new graph.
Contents
Summary
Online
The graph keeps accepting reads and writes during a backup.
Contents
The archive holds the graph’s stored data, including the history log, schema and indexes.
Restore
Creates a new graph from an archive and refuses if the name already exists.
Integrity check on open
When the restored graph opens, its files are checked against their integrity hashes, and the restore fails if any file differs.
Safety
Restore rejects archive entries with absolute paths, .. components, symbolic links, or hard links.
Managed cloud
Managed cloud: contact support to request a backup, export or restore of a graph.
Self-host
On a self-hosted server, an admin runs backup and restore over HTTP. Both endpoints require an admin key, and both read or write files on the server.
POST /graphs/{name}/backup
Flushes the graph, then writes a gzip-compressed tar archive of the graph to a path on the server. The graph keeps accepting reads and writes during the backup. From 1.4.3.3 the archive also holds a file that a write created for the first time while the backup was taking its cut (for example the catalog of the graph’s first index or constraint, or a first access policy); before, the archive could hold the write without that file. The same applies to clones.
Requires an admin key. output_path is a path on the server and must be inside the backup directory the operator has configured; if none is configured, every path is refused.
Request body — JSON:
Response — JSON on success, HTTP 200:
Archive contents. The archive is a gzipped tar of the graph’s stored files. It contains:
- The graph’s current data, with integrity hashes for its files.
- The history log, the append-only record of writes (see Bitemporal history is included).
- Writes that were acknowledged before the backup, so the restored graph opens with them.
- Schema and index definitions.
Copy archives off the server for safekeeping.
POST /graphs/{name}/restore
Creates a new graph named {name} from an archive. It refuses if a graph with that name already exists, so it cannot overwrite a live graph. To replace an existing graph, restore under a new name first, then switch your callers to the new name.
Requires an admin key. input_path must be an existing file inside the configured backup directory.
Request body — JSON:
Response — JSON on success, HTTP 200:
What restore does. Restore unpacks the archive into a new graph and opens it. Archive entries with absolute paths, .. components, symbolic links, or hard links are rejected. When the restored graph opens, its files are checked against their integrity hashes, and the restore fails if any file differs. The graph opens at the state the backup captured.
Errors. If the archive cannot be read, contains a rejected entry, or the name already exists, the request fails with HTTP 400 and a message describing the problem. If a file fails its integrity check, the request fails with HTTP 500 ("error": "storage") and a message that starts with snapshot integrity check failed. A failed restore can leave a partial graph under the new name; restore again under a different name.
Bitemporal history is included
InvariantDB records both when a fact was true (valid time) and when the system recorded it (recorded time). That history lives in an append-only log stored with the graph. It is the source for AT VALID, AT RECORDED, and OVER VALID BETWEEN queries, and for history-chain verification.
Each archive contains the history log. After a restore:
AT VALIDandAT RECORDEDqueries for times up to the backup return the same answers they returned before the backup was taken.GET /graphs/{name}/audit/verifyre-verifies the history chain over the restored graph.db.beliefLineagewalks the belief revisions in the archive.
AT VALID and AT RECORDED. You do not need to restore an old archive to see what the graph looked like last Tuesday; query the live graph with AT RECORDED <last Tuesday>. See Bitemporal queries.
Full archives
Each archive is a full copy of the graph’s stored files, with integrity hashes that are checked when the graph opens. It is not a delta against a previous archive. Two consequences:
- Any one archive can restore the graph. You do not need a chain of archives to restore a point in time.
- Archive size grows with the size of the graph, including its history log.
Restore opens the graph at the state the backup captured. The history log carries earlier versions, so AT RECORDED queries for times before the backup return the same results on the restored graph.
Encryption at rest
On managed cloud, contact support for how archives are stored and encrypted.
On a self-hosted server, the archive is gzip-compressed but not encrypted. The server writes it to output_path; store it on an encrypted volume or in encrypted object storage.
Retention
Managed cloud: contact support for the retention of backups taken for you.
Self-hosted: the server never deletes archives. The operator decides how long to keep them.
Cross-region disaster recovery
What is available today:
- Archive copies in another region. Archives are files. You can copy them to storage in another region and restore from there with the ordinary restore path.
- No automatic writer failover across regions. See Availability for the current posture.
Backup, restore, and verify example
End-to-end example on a self-hosted server. Replace <your-server> with your server’s address.
1. Take a backup
The response reports output_path and the number of bytes written.
2. Restore under a new name
A 200 means the archive was unpacked, its files passed the integrity check, and the graph is open. current_snapshot_seq identifies the restored state.
3. Check the restored graph on a schedule
Step 2 already checked the archive’s files when the graph opened. For an ongoing check, schedule a restore into a scratch graph on a cadence that matches your RPO.
4. Verify the history chain
Compare records and last_seq with the same call on my-graph. They match if my-graph has received no writes since the backup.
5. (Optional) Compare a specific belief
To check that a specific belief was restored, walk its revisions on both graphs and compare:
Matching output on my-graph and my-graph-verify shows that the belief’s revisions and evidence were restored.
Related
- Operations — health checks and how to reach support.
- Availability — the current single-writer availability posture.
- Bitemporal queries — point-in-time queries served against the live graph, not against archives.
- Provenance — belief lineage and evidence links, which are included in the archive.
- Crypto-shred — per-subject encryption keys and key destruction (in development).
- What’s new — capabilities and changes in each release.
Backup and restore cover one graph on one server. For the current availability posture, see Availability.