The graphersal store Command
graphersal store <COMMAND> ... manages a Store from the command line. The store
itself is used with graphersal --graph <DIR> (the REPL, -e, --in, --server): every commit
of a query is durable before the query returns.
graphersal store help # the overview (also: graphersal store, without a command)
graphersal store help rollback # one command
graphersal store rollback --help # the same (-h works too)
Conventions
-
DIRis a store: a directory, or a single-file store (an existing file, or a new path ending in.gstore). Every command works on both. -
TARGETis one of--at-commit <N>(right after commit N),--at-time <TIME>(after the last commit at or before TIME) or--at-mark <NAME>.TIMEis an RFC 3339 / ISO 8601 date-time with a zone (2026-10-08T02:43:00Z,2026-10-08T02:43Z,2026-10-08T04:43:00+02:00) or microseconds since the Unix epoch; it covers the whole second (minute) it names. A bare date (2026-10-08) is refused with the explicit forms to write instead (2026-10-08T23:59:59Zfor the end of that day in UTC,2026-10-08T00:00:00+02:00with an offset). See Point in Time. -
Options take their value as the next argument or after
=(--up-to 5,--up-to=5). An option a command does not know is a usage error. -
Exit codes:
0ok;1the operation failed (the diagnostic with aHelp:line is on stderr),verifyfound damage, orrepairlost data;2invalid invocation (unknown command or option, a missing argument or option value, a bad time,graphersal storewithout a command). The same holds forgraphersal --graph <DIR>: a store that cannot be opened (in use, damaged beyond a read-only open, an older format) exits1; a<DIR>that is not a store (without--create-store) or a wrong option exits2. A command whose stdout was closed before its output was written (graphersal store info x | head -1) completes, closes the store and exits141(unless it failed: then its own code). -
Warnings of the store library (damage found, a read-only open, a failed write of
GRAPH, a failed automatic checkpoint) are printed on stderr asWARN graphersal::persist::store: ..., never on stdout: by thestorecommands and by every mode ofgraphersal --graph <DIR>(-e,--in, a script file, the REPL,--server).GRAPHERSAL_LOGsets the level:off,error,warn(default),info,debug,trace. -
A read-write open (
--graph <DIR>,mark,prune,rollback,compact,attic restore|remove) that finds oneGRAPHcopy missing, damaged or stale rewrites it from the other and says so in a note, with the command that checks the rest:note: the store data/: GRAPH.copy is not usable (...); GRAPH is used; the other copy was rewritten from it # check the rest of the store graphersal store verify data/ -
Layout. Every result is one block per thing the command did: a short headline, then one indented
key: valueper line, and every shell command on a line of its own under a# commentsaying what it does (never inside a sentence); blocks are set apart by a blank line. Lists of records (models,attic) show one section per record with one field per line. A usage error ends with the command that shows the usage, an error'sHelp:lists its commands the same way. -
Times are printed in UTC (
2026-10-08T07:05:08Z), in the form--at-timeaccepts back. -
While the store is open elsewhere (a dev server, a REPL):
info,list,marks,verify,fork,backup,export,repair,compact-adviceandattic(list, changes, fork) work;mark,checkpoint,prune,compact,rollback,attic restore|removeandconvertfail with "in use" (exit 1): use the dev server's Store menu, or stop the writer. -
On a backup directory the reading commands work,
pruneprunes the backup,restoremakes it the live store, and the commands that write report that it is a backup.
Commands
| Command | Does |
|---|---|
create | create a store |
info | identity, position, snapshots, marks, WAL size |
list | the snapshots |
marks | the marks |
mark | name the current position |
checkpoint | merge a snapshot now (closed store) |
verify | scrub every checksum |
journal | the system journal: what the store did |
fork | a past state as a new store |
rollback | take the store back in place |
attic | list, inspect, restore, fork, remove rolled-back history |
backup | full, incremental or ZIP backup |
restore | a backup (or ZIP) as the live store |
export | a stored snapshot as a .gsnap |
materialize | a layer store's whole visible graph as a standalone .gsnap |
models | the embedding models the store keeps; remove one |
prune | remove old history |
compact | prune to now; give a single file's free space back |
compact-advice | is compact worth it? |
convert | a directory into a single file, or back |
upgrade | a store of an older Graphersal, converted to the current format |
repair | a damaged store, repaired into a new directory |
restore-blobs | missing or damaged blobs copied back from another copy |
Layer stores (a layer's changes to a frozen base, kept with graphersal --graph <base> --layer-store <dir>; Layers):
the commands that read or copy files work on them without the base (info, list, marks,
journal, the attic listing and changes, backup, restore, export, convert,
upgrade). Those that load the layer take --base <SOURCE>, the base it was created over (a
store directory or .gstore, opened read-only, or a .gsnap): verify, checkpoint, fork,
rollback, attic restore|remove|fork and materialize. Without it they exit 1 with the
LayerStore reason and a note naming --base; another base exits 1 naming both
(LayerBaseMismatch); a --base that is not a store or .gsnap is a usage error (exit 2).
repair and models remove|default refuse a layer store (exit 1), and models <DIR> says that
its graph serves the base's models. The commands' "open it" hints name --layer-store.
create
graphersal store create <DIR> [--from <SOURCE>] [--chunk-size <BYTES>] [--single-file]
[--on-damage maintenance|continue]
Creates a store in the new (missing or empty) DIR, at commit 0 with one snapshot. The chunk
size, the damage policy and the backend are fixed for the store's life.
| Option | |
|---|---|
--from <SOURCE> | the initial graph: the --graph sources modern, empty, large, tree, a GraphSON/GraphML file, or a packed snapshot (.gsnap, copied as is). Default: an empty graph |
--chunk-size <BYTES> | the snapshot chunk size (default 1 MiB), fixed for the store's life |
--single-file | a single-file store whatever the name (a DIR ending in .gstore is one anyway) |
--on-damage <POLICY> | what the store does when damage is found on disk while it is open: maintenance (default: it turns read-only) or continue (it keeps committing and reports the damage); fixed for the store's life |
$ graphersal store create data/ --from modern
Created the store data/
graph: 01a11a54-8209-7661-92e2-147ae6d8bbd3
commit: 0
snapshots: 1
damage policy: maintenance (fixed for its life)
# open it in the REPL
graphersal --graph data/
# or serve it to the browser playground
graphersal --graph data/ --server
$ graphersal store create graph.gstore --from modern --on-damage continue
Created the single-file store graph.gstore
graph: 01a11a54-8ca5-7fd3-8ed5-fcd7729f0e80
commit: 0
snapshots: 1
damage policy: continue (fixed for its life)
# open it in the REPL
graphersal --graph graph.gstore
# or serve it to the browser playground
graphersal --graph graph.gstore --server
A packed snapshot makes the store without opening it (Store::create_from_packed_dir), and what
the file brought that still needs your decision is printed as store upgrade prints it (exit
code 0): the converted models of a Graphersal 0.4.0 file, a warning: for every model the
schema needs that the file does not carry (a 0.4.0 file whose model came from --embedder, or an
export --without-models; the store is created and opens once the model is imported, with the
commands named), a note: per model for the vector properties without a source property (one
note listing them with one combined patch), a note: for every saved query writing such a
property directly and for every
saved query calling a removed function. Each note is a short headline with one detail per line
below it and every command on a line of its own under a comment saying what it does; notes are
separated by a blank line. When the store has no default model and the missing model is the
only one the schema names, its import takes --default:
$ graphersal store create data/ --from old.gsnap
Created the store data/
graph: 01a11a54-9f3c-7b21-8e0d-5a2c9e41d7b3
commit: 3120
snapshots: 1
damage policy: maintenance (fixed for its life)
warning: the schema needs the embedding model acme/tiny, which the store does not keep
identity: model2vec/acme/tiny@0123456789ab
needed by: doc.emb
effect: the store does not open until the model is imported
# download the model into the local models directory
graphersal embed-model download acme/tiny
# import it into the store as its default model (embed() without a model name uses it)
graphersal embed-model import acme/tiny --into data/ --default
note: doc.emb has vectors of model2vec/acme/tiny@0123456789ab but no source property
vectors: 250 element(s)
...
Open data/
# open it in the REPL
graphersal --graph data/
# or serve it to the browser playground
graphersal --graph data/ --server
Exit 2 when the source cannot be loaded or --on-damage names no policy; 1 when DIR is a
directory that is not empty (cannot create a store in data/: the directory is not empty, with
the help to choose an empty or new directory, or to look at it with graphersal store info data/ if it is a store) or a store already (it is a store already). graphersal --graph <DIR> --create-store [--on-damage <POLICY>] creates a store on first
use instead (--on-damage without --create-store is a usage error; for an existing store with
another policy it is refused: the policy never changes).
info
graphersal store info <DIR>
$ graphersal store info data/
store data/
format version 2
graph id 01a11a54-8209-7661-92e2-147ae6d8bbd3
state closed cleanly
commit 3 (2026-10-08T07:05:08Z)
snapshots 2
latest commit 3 (8 vertices, 6 edges)
marks 1
definitions 2 (compression 1, query 1)
wal 2 segment(s), 462 bytes
file a directory
fixed at creation (never changed):
store id 01a11a54-820a-7c33-b1f0-5d2e9a7c4e10
created 2026-10-08T07:05:08Z
chunk size 1048576 bytes
on damage maintenance (damage found while open makes the store read-only)
backend directory (format version 4)
Also printed when they apply: for a layer store its base as base under "fixed at creation",
with the command that opens it (graphersal --graph <BASE> --layer-store <DIR>; it holds only a
layer's changes to that base and opens only over it, and a backup of it is useless without
that base, which store backup warns about; see
Layers for the commands that
take --base), parent and branched at (a fork, a rolled-back store), backup up to commit N with taken and access below it and the command that makes it the live store
(a backup), attic N entr(y/ies), the embedding models the store keeps
(a models block: one block per model under its repository, one field per line: full name
(the identity), size, licence, licence text, default, used by; a model the schema names
but the store lacks as missing model, see models), the store's blobs (blobs N (size) with in use and unused below it: a blob is in use
while a retained history references it, for example the catalog definition of a model the
schema uses, and the next prune removes the unused ones; in use not counted when the
references could not be read; see Blobs), and for a single file its
size with live and free below it and the command that tells whether compacting pays:
file single file, 23.0 KiB
live 23.0 KiB
free 0 B inside the file
# see whether compacting gives that space back
graphersal store compact-advice graph.gstore
state is open (in use, or not closed cleanly) while a writer has it (or after a crash).
A store written by a newer Graphersal (its GRAPH, a snapshot or WAL file, or the single
file's container of a newer format version) is not read: info, like every store command
(upgrade and repair included) and --graph, exits 1 with the refusal and changes nothing
(no lock file either):
$ graphersal store info data/
Error: Unsupported format version 4 of the store data/ (store format version): written by a newer Graphersal (this build reads up to version 3)
Help: The store or file was written by a newer Graphersal; open it with that version (or a later one). ...
See Format Versions.
list
graphersal store list <DIR>
commit last commit vertices edges name
0 - 6 6
3 2026-10-08T07:05:08Z 8 6 nightly
The snapshots, oldest first: the commit, the time of that commit, the counts, the name. Reads only the manifests' first 4 KiB.
marks
graphersal store marks <DIR>
1 2026-10-08T07:05:08Z before-import
The marks: commit, time, name.
mark
graphersal store mark <DIR> <NAME>
Sets the mark NAME at the current position (Mark "before-import" at commit 1.). Names are
unique along the store's whole history. "In use" while a server has the store open (its Store
menu has Mark).
checkpoint
graphersal store checkpoint <DIR> [--name <NAME>] [--base <SOURCE>]
Writes a snapshot of the current state of the CLOSED store, merged from the last snapshot and the WAL after it without loading the graph (how):
Snapshot at commit 3
vertices: 8
edges: 6
merged from: the snapshot at commit 0 and 3 commits
segment files: 4 reused, 0 copied, 1 written
written: no: nothing was committed after it, no new snapshot written when the newest snapshot
is current.
"In use" while another process has the store open (a server's Store menu has Checkpoint,
which merges the same way while commits go on). Damage in what it reads stops it with exit 1 and
nothing written; run verify. A layer store needs --base: its layer is loaded over the base
and encoded (encoded from: the loaded graph ...), a snapshot the size of its changes.
verify
graphersal store verify <DIR> [--base <SOURCE>]
Reads every checksum (snapshots, WAL, GRAPH, marks) and says what it read (Checked the store data/ with snapshots, WAL segments, records and commits below it). Exit 0 with ok: no damage found;
exit 1 with every problem and the damage report (the donor of each damaged item). See
Verify. Files of a newer format version are never listed as damage: verify
exits 1 with the "written by a newer Graphersal" refusal shown under info (no
DAMAGE lines, no repair advice), and store repair refuses such a store the same way. A layer
store is checked without its base file by file (a note: says its snapshots were not loaded,
and a block names store verify <DIR> --base <BASE>); with --base every snapshot is also
loaded over the base.
fork
graphersal store fork <DIR> <NEW_DIR> [TARGET] [--base <SOURCE>]
A new store in NEW_DIR (it must not exist, or be empty) from the state at TARGET (default:
the latest), with a new lineage that records DIR as its parent. DIR is not changed.
$ graphersal store fork data/ branch/ --at-mark before-import
Forked data/ into branch/
at commit: 1
graph: 01a11a54-87d2-7995-b2cb-e450e4319735
parent: 01a11a54-8209-7661-92e2-147ae6d8bbd3
marks not carried: 1 (they stay targets of data/ only)
mark: before-import @ commit 1
undo: delete the directory branch/ (data/ is unchanged)
# open it in the REPL
graphersal --graph branch/
# or serve it to the browser playground
graphersal --graph branch/ --server
A fork starts without marks: the marks not carried and mark lines (printed only when there are any) name
the source's marks at or before the fork's position. Exit 1 when the target is not reached
(Recovery target mark "nosuch" not reached). A layer store needs --base; the fork is a new
layer store over the same base (its hint: graphersal --graph <SOURCE> --layer-store <NEW_DIR>).
rollback
graphersal store rollback <DIR> TARGET [--delete]
Rolls the store back in place to TARGET: everything after it moves to the attic (with
--delete: deleted, no undo), and the store continues as a new lineage. Prints the attic id and
the commands that undo it. Exit 2 without a target; exit 1 when there is nothing after the target
or the store is in use. See Rollback and the Attic.
$ graphersal store rollback data/ --at-commit 1 --delete
Rolled back data/ from commit 4 to commit 1
new lineage: 01a11a54-8b90-7dba-b74a-cadc851e226f
history after it: commits 2..=4, 1 snapshot(s), 2 WAL file(s)
kept: no: deleted, this cannot be undone
$ graphersal store rollback data/ --at-mark before-import
Rolled back data/ from commit 4 to commit 1
new lineage: 01a11a54-8b91-7c02-9d4e-3f6a8b2c1d07
history after it: commits 2..=4, 1 snapshot(s), 2 WAL file(s)
kept: in the attic as 20261008T070510Z-00000000000000000002
# undo (only while nothing new is committed or marked)
graphersal store attic data/ restore 20261008T070510Z-00000000000000000002
# or keep it as a new store
graphersal store attic data/ fork 20261008T070510Z-00000000000000000002 <NEW_DIR>
# or delete it
graphersal store attic data/ remove 20261008T070510Z-00000000000000000002
attic
graphersal store attic <DIR> list the entries
graphersal store attic <DIR> changes <ID> the commits of an entry
graphersal store attic <DIR> restore <ID> undo its rollback
graphersal store attic <DIR> fork <ID> <NEW_DIR> the entry as a new store
graphersal store attic <DIR> remove <ID> delete the entry for good
$ graphersal store attic data/
── Attic entry ───────────────────────────────────────────────────────────────
id: 20261008T070510Z-00000000000000000002
commits: 2..=4
rolled back: 2026-10-08T07:05:10Z
reason: rollback to mark "before-import"
size: 9.3 KiB
snapshots: 1
$ graphersal store attic data/ restore 20261008T070510Z-00000000000000000002
Restored 20261008T070510Z-00000000000000000002: the store is at commit 4 again.
One section per entry, one field per line (The attic is empty. without entries). restore
works only while nothing was committed or marked since that rollback; fork always
does (and lists the marks of the entry's history it does not carry, like store fork). restore and remove are "in use" while a server has the store open.
backup
graphersal store backup <DIR> <BACKUP_DIR> [--full]
graphersal store backup <DIR> <FILE.zip> --zip [--without-models]
A consistent copy up to the last durable commit; works while a server has the store open. Into an
empty or new BACKUP_DIR: a full backup. Into an existing backup of DIR: an incremental
one. --full forces a full backup (the directory must be empty or new). --zip writes one ZIP
archive (always full; the file must not exist; feature persist-zip, on in the CLI).
$ graphersal store backup data/ backup/
Full backup into backup/
snapshot: commit 3
WAL: up to commit 3
WAL segments copied: 1
files: 8
bytes: 9605
The backup backup/ is read-only
# open it read-only in the REPL
graphersal --graph backup/
# make it the live store
graphersal store restore backup/
$ graphersal store backup data/ backup/
Incremental backup into backup/
state: current (nothing new since commit 4)
The backup backup/ is read-only
...
$ graphersal store backup data/ data.zip --zip
Full backup into data.zip
snapshot: commit 3
WAL: up to commit 4
files: 8
bytes: 9688
checked: every checksum read back
# unpack it into a new live store
graphersal store restore data.zip <NEW_DIR>
An increment that copied something lists commits (5..7 (3 new)), snapshots copied, WAL segments copied (with their numbers in brackets), bytes appended to the last segment and
bytes.
The store's embedding models are copied too, with their cards and licence
files, and the report lists them (It carries 1 embedding model(s) with their licences, then one
section per model as models shows it): who hands a backup on redistributes them.
--without-models (with --zip only; a usage error otherwise) leaves them out: such an archive is
also restored by Graphersal 0.3.0, which refuses one with models as written by a newer version.
Every checksum of what is copied is read in DIR first and again in the copy (a ZIP archive is
read back). Damage stops the backup (exit 1): nothing of it is kept (a new directory or archive
is removed, an increment rolled back), and the report names the damaged files and recommends
repairing the STORE (store repair DIR --to NEW_DIR), never the backup. Damage of a redundant
copy (one GRAPH copy, one manifest copy, the marks file) is a warning: on stderr; the backup
is intact.
$ graphersal store backup data/ backup/
Error: The backup stopped: the store data/ is damaged: wal/00000000000000000001.wal at byte 64: record of commit 1: checksum mismatch; nothing of the backup into backup/ was kept
Help: Repair the MAIN store, never the backup: Store::repair_dir builds a verified, repaired copy ...
# build a repaired copy of the main store
graphersal store repair data/ --to <new_dir>
# show the full damage report
graphersal store verify data/
Refused (exit 1, the backup unchanged): a backup of another graph, a directory holding a store
that is not a backup, a non-empty directory without a backup, --full into a non-empty directory,
a rollback of the store behind the backup, a pruned gap, a fork, repair or conversion of the
backed-up store (another store id). --zip --full is a usage error (exit 2: "--zip backups are
always full: drop --full").
--from-memory is a usage error here (exit 2) that says where it works: a backup from memory
writes the graph of a store open in this process (whose files are damaged), and this command
runs in a new process. Use the dev server's Store menu (Back up from memory), POST /api/store/backup {"from_memory": true}, or Python store.backup(path, from_memory=True). See
Backup and Restore.
restore
graphersal store restore <BACKUP_DIR>
graphersal store restore <FILE.zip> <DIR>
With one argument: makes the backup in BACKUP_DIR the live store, in place, with the
original's graph id (a backup directory of an older Graphersal: upgrade it first).
With two: unpacks a ZIP backup into the new directory DIR as the live store; a ZIP of an older
Graphersal's store is upgraded to the current format as it is unpacked (verified). To keep a backup as it is, fork it instead (store fork BACKUP_DIR NEW_DIR).
$ graphersal store restore backup/
Restored backup/: it is the live store now
backup: up to commit 4
taken: 2026-10-08T07:05:09Z
graph id: the same
# open it in the REPL
graphersal --graph backup/
# or serve it to the browser playground
graphersal --graph backup/ --server
$ graphersal store restore data.zip restored/
Restored data.zip into restored/: it is the live store
# open it in the REPL
graphersal --graph restored/
# or serve it to the browser playground
graphersal --graph restored/ --server
export
graphersal store export <DIR> <FILE.gsnap> [--commit <N>] [--without-models]
Writes the latest stored snapshot (or the one at commit N, which must be a snapshot's commit:
store list) as one packed file (Exported the snapshot at commit 3 to data.gsnap.). Load it
with --graph FILE.gsnap, store create --from FILE.gsnap, or the playground.
The file carries the store's embedding models with their cards and licences
(listed after the first line, one section per model) as blobs, unless --without-models (the definitions stay; the
models are missing in what is made from the file: graphersal embed-model import <repo> --into <store> writes a missing model's blob back). store create --from FILE.gsnap and the
playground put them back into a store. A damaged model blob stops the export (exit 1; export
--without-models).
materialize
graphersal store materialize <DIR> <FILE.gsnap> --base <SOURCE> [TARGET] [--without-models]
Writes the whole graph a LAYER STORE shows at TARGET (default: the latest) as one standalone
packed file: the base's elements with the layer's changes applied, the layer's schema and
catalog, file format version 4. Unlike export (a layer snapshot, which loads only over its
base) the file needs no base: --graph FILE.gsnap, store create --from FILE.gsnap and older
Graphersal releases read it; its size follows the whole graph. The base's embedding models the
layer's catalog references travel with it unless --without-models. Reads the files only (no
lock), so it works while a server has DIR open.
$ graphersal store materialize project whole.gsnap --base product
Materialized the layer store project at commit 1 into whole.gsnap
vertices: 7
edges: 6
standalone: yes: the whole graph (base and layer), it needs no base
# open it in the REPL
graphersal --graph whole.gsnap
--base is required (exit 2 without it); a plain store is refused (exit 1, naming store export).
models
graphersal store models <DIR>
graphersal store models default <DIR> <REPO>|--none
graphersal store models remove <DIR> <REPO>
Lists the embedding models of the store's latest state, one section per model
(styled like the sections of the --server banner) with one key: value per line: model (the
repository), full name (the identity a schema's embedder records,
model2vec/<repo>@<12 hex>), size (of its blob), licence, licence text, default,
used by (the schema places that need it), then gated and problem (a missing or damaged
blob) when they apply; then a section for every model the schema names that the store does not
keep (Missing embedding model). Works while a server has the store open.
licence text says where the text the store keeps beside the model comes from; Graphersal never
writes a licence:
from the repository (its own licence file): the repository's own licence file;standard MIT text (the repository has no licence file): the unchanged standard text of the licence the model card names (bundled for MIT and Apache-2.0; the copyright holders are those the model card names), andlicencesaysmit (named in the model card);none (no standard text for this licence).
$ graphersal store models data/
── Embedding model ───────────────────────────────────────────────────────────
model: acme/tiny
full name: model2vec/acme/tiny@0123456789ab
size: 29.5 MiB
licence: mit (named in the model card)
licence text: standard MIT text (the repository has no licence file)
default: no
used by: the schema (doc.emb)
── Embedding model ───────────────────────────────────────────────────────────
model: acme/other
full name: model2vec/acme/other@456789abcdef
size: 7.6 MiB
licence: apache-2.0
licence text: from the repository (its own licence file)
default: yes
used by: nothing (not used by the schema)
default makes the model of REPO the default model (the one embed() uses without a name;
--none clears it, hash-ngram/1 is then the default), as one commit appended to the WAL
WITHOUT loading the graph; refused for an unknown repository and while a writer has the store
open. graphersal embed-model import <REPO> --into <DIR> --default imports and sets it at once.
remove removes one model by its repository as one commit appended to the WAL WITHOUT loading
the graph (format spec 12.12; earlier positions keep it; its blob goes with the prune that drops
the last history referencing it). It is refused while a writer has
the store open, on a backup, while the schema needs the model (its properties are named), and for
an unknown repository (exit 1). Models enter a store by graphersal embed-model download <REPO> --into <DIR> and
graphersal embed-model import <REPO|MODEL_DIR> --into <DIR> [--default] [--replace] (see
Embedding Models in a Store).
prune
graphersal store prune <DIR> --up-to <COMMIT> [--drop-marks]
Removes snapshots and WAL only needed for targets before COMMIT; the last two snapshots and the
attic's bases always stay:
$ graphersal store prune data/ --up-to 1200
Pruned data/
kept from: commit 1100
snapshots removed: 2 (at commits 0, 600)
WAL segments removed: 1
Without --up-to it is a usage error (exit 2: nothing is pruned implicitly). On a backup
directory it prunes the backup.
A prune never makes a mark unreachable unless told to: when it would remove the history a mark needs, it names those marks, changes nothing and exits 1:
$ graphersal store prune data --up-to 4
Error: `store prune` would make the mark(s) "m0", "m1" unreachable: it removes the history they need, so they cannot be opened, forked or rolled back to afterwards (only from a backup that holds older snapshots). Nothing was changed.
Help: run it again with --drop-marks to prune anyway, or back the store up first
# back the store up first
graphersal store backup data <BACKUP_DIR>
With --drop-marks it prunes and names them (marks no longer reachable: m0, m1 (their history was pruned)); store marks no longer lists them. Without affected marks the flag changes
nothing. A prune also removes the blobs no retained history references any
more and says so (unreferenced blobs removed: N (size)). See Prune, Compact and Retention.
compact
graphersal store compact <DIR> [--drop-marks]
Prunes up to the current commit, then, for a single-file store, rewrites the file without its
free space (the disk needs room for the live data meanwhile). On a directory the prune is all.
Like prune, it refuses (exit 1, nothing changed) when the prune would make marks unreachable,
naming them, unless --drop-marks is given; compact-advice lists them beforehand
(marks lost: m0, m1 (...)).
$ graphersal store compact graph.gstore
Compacted graph.gstore
kept from: commit 0
snapshots removed: 0
WAL segments removed: 0
file: 23.7 KiB -> 22.8 KiB (930 B given back)
journal
graphersal store journal <DIR> [--level <L>] [--since <TIME>] [--source <P>] [--kind <K>]
[--after <SEQ> | --last <N>] [--limit <N>] [--follow] [--json]
Prints the store's system journal: one line per record (time in UTC, #seq,
level, kind, message, fields), oldest first. It reads the files only (no lock, nothing written),
so it works while a server has the store open; the records an open store has not written yet
(below error, written in batches) appear after its next batch or its close.
--level error|warn|notice|info: that level and the more severe ones.--since TIME: the records at or after TIME (the TIME forms of the other commands).--source P: a source and the ones below it (storematchesstore.backup).--kind K: one kind (store.backup_done,auth.denied, ...).--after SEQ,--limit N: the records after a cursor, at most N (default 1000).--last N: only the newest N matching records, read from the end of the journal (the older segments are not read), printed oldest first; with--followit goes on from there.--json: one JSON object per record (seq,origin,origin_seq,timein µs,level,source,kind,message,fields, ...).--follow: keeps printing new records (it polls once a second) until it is interrupted.
Damaged records are skipped with a note: on stderr; they never make the command fail.
$ graphersal store journal data/ --level notice
2026-10-30T09:12:01.000000Z #1 notice store.created the store was created (create) (how=create)
2026-10-30T09:40:17.000000Z #9 notice store.backup_done a full backup to /backups/data holds commit 52 (...)
compact-advice
graphersal store compact-advice <DIR> [--min-ratio <R>] [--min-reclaimable <BYTES>] [--min-size <BYTES>]
Whether compact is worth it now, and the numbers; cheap (reads only names, sizes and small metadata files, no element data) and works while a server
has the store open. The rule: at least --min-ratio of the store (0.0..1.0, default 0.5) and
--min-reclaimable bytes (default 64 MiB) to gain, in a store of at least --min-size bytes
(default 64 MiB), and enough free disk space. Always exit 0 (the answer is in the text: compact now: ... with the command under # compact the store now, or no compaction needed: ...).
$ graphersal store compact-advice data/
no compaction needed: the store is smaller than the minimum of 64.0 MiB
store: 9.6 KiB (directory: compact = prune)
prune: 0 B
reclaimable: 0 B (0 % of the store)
decided by: total_bytes
convert
graphersal store convert <DIR> <NEW> [--single-file] [--fill-blobs <SOURCE>]
Copies the whole closed store (snapshots, WAL, marks, attic) into NEW, byte for byte: a directory
into a single file (NEW ending in .gstore, or --single-file) or back. NEW must not exist
(or be an empty directory); the copy is verified; DIR is not changed. The copy is a new store
with its own store id (creation parameters): it does not continue the
backups of DIR (its first backup is a full one into a new directory).
A store whose catalog references a blob missing from its blobs/ (a model blob, say) does not
verify, so its copy is refused. --fill-blobs <SOURCE> takes every such blob from SOURCE into
the copy, checked by length, CRC-32C and hash: a directory laid out as blobs/<2 hex>/<hash> (a
shared model directory, another store, a backup), a ZIP backup or a .gsnap, as for
store restore-blobs. SOURCE is only read; the note adds
blobs filled: <n> (<size>) from <SOURCE>. A blob SOURCE lacks too, or holds with other bytes,
fails the command (exit 1) and leaves no copy. Rust: Store::convert_with with
ConvertOptions::with_fill_missing_blobs; ConvertOptions::with_skip_missing_blobs (Rust only)
makes the copy without such a blob and lists it instead (Blobs).
$ graphersal store convert data/ graph.gstore
Copied the store data/ into the single file graph.gstore
files: 9
size: 9.6 KiB
verified: yes
source: data/ is unchanged
# open it in the REPL
graphersal --graph graph.gstore
# or serve it to the browser playground
graphersal --graph graph.gstore --server
upgrade
graphersal store upgrade <DIR> <NEW> [--single-file]
graphersal store upgrade <DIR> --in-place
Converts a store written by an older Graphersal (store format version 2: Graphersal 0.1.x; 3:
Graphersal 0.2.x to 0.4.x) to the current format, without the older binary. DIR is a store directory, a single-file store or a
backup directory (it stays a backup). With NEW: a new store in NEW (a new or empty directory,
or a single file: NEW ending in .gstore, or --single-file); DIR is not changed. With
--in-place: DIR itself; back it up first (a copy of the closed directory or file will do):
afterwards the older Graphersal refuses it as newer.
Everything is carried: the graph, its schema and catalog, the history (snapshots and WAL), the
marks, the lineage, the attic entries and the store's identity and
creation parameters; only GRAPH and GRAPH.copy are rewritten, every
other file stays byte for byte. DIR is verified first. Exit 1 when it is damaged (nothing is
written; store repair DIR --to NEW writes a repaired store of the current format), in use (a
server or another writer has it open), of a newer or a pre-release version, or a copy of a store
that is already current; exit 2 without NEW or --in-place, or with a NEW that exists. An
upgrade in place of a current store prints nothing to do (exit 0). An interrupted upgrade leaves
no store in NEW (run it again: it clears what was left), and in place leaves the store either
older or upgraded (run it again). A ZIP backup of an older store is upgraded by
store restore FILE.zip DIR. See Format Versions.
The embedding models of a Graphersal 0.4.0 store (models/) become blobs defined by one commit
(0.4.0 -> 0.5.0); a damaged one refuses the
upgrade before anything is written (exit 1, StoreFailure::UpgradeModelDamaged). What still
needs your decision is printed, the exit code stays 0: a warning: for every model the
schema needs that the store does not keep (with the commands that import it: the store opens
once it is there), a note: per model for the vector properties with a model but no source property
from (one combined schema patch for all properties of the model, one label per line; when that
model is one of the missing ones, the comment above the patch says it runs after the model's
import, since the store opens only then), and a note: for every
saved query writing such a property directly (a vector rule refuses that write). Each note is a
short headline with one detail per line and every command on a line of its own under a comment;
notes are separated by a blank line (layout: Format Versions):
$ graphersal store upgrade store/ --in-place
Verified the store store/
store format version: 3
snapshots: 2
WAL segments: 1
records: 12
Upgraded store/ in place to store format version 4
GRAPH: rewritten
every other file: kept, the models/ directory migrated (below)
the older Graphersal: no longer opens it
Converted the embedding model model2vec/acme/tiny@70c61d0ed332 into a blob with its catalog definition
full name: model2vec/acme/tiny@70c61d0ed332
size: 8.5 KiB
The models were defined by commit 12; the history before it has no models.
# take a full backup now: a backup taken before the upgrade does not take increments of the upgraded store
graphersal store backup store/ <new_dir>
note: doc.emb has vectors of acme/tiny but no source property
vectors: 3 element(s)
to keep them current: add "from": "<source property>" to its schema declaration
first fill: re-embeds every doc (the whole database is locked while it runs)
afterwards: write the source property, never emb itself
# add the source property (replace <source property> first)
graphersal --graph store/ -e 'g.patch_schema(#{vertices: #{doc: #{schema: #{properties: #{emb: #{from: "<source property>"}}}}}})'
Open store/
# open it in the REPL
graphersal --graph store/
# or serve it to the browser playground
graphersal --graph store/ --server
Which versions are upgraded, and how, is decided by one table (the same in
Format Versions and the
format specification 15.1); a version without a supported row is
refused before anything is written, a row "into a copy only" refuses --in-place
(StoreFailure::UpgradeNeedsCopy), and a store with any file of a newer version is refused like
every other command does (below):
| From store format version | Written by | To | Upgrade |
|---|---|---|---|
| 1 | never released (no store id) | 4 | unsupported (packed snapshot) |
| 2 | Graphersal 0.1.x (no models: the version word only) | 4 | in place or into a copy (migration) |
| 3 | Graphersal 0.2.x - 0.4.x | 4 | in place or into a copy (migration) |
| 4 | Graphersal 0.5.x and later | 4 | nothing to do |
$ graphersal store upgrade old/ new/
Verified the store old/
store format version: 2
snapshots: 2
WAL segments: 2
records: 10
Upgraded old/ into new/
store format version: 4
files: 15
size: 21.2 KiB
verified: yes
source: old/ is unchanged (keep using new/: it is the same store, with the same identity)
Open new/
# open it in the REPL
graphersal --graph new/
# or serve it to the browser playground
graphersal --graph new/ --server
$ graphersal store upgrade old/ --in-place
Verified the store old/
...
Upgraded old/ in place to store format version 4
GRAPH: rewritten
every other file: kept
the older Graphersal: no longer opens it
Open old/
# open it in the REPL
graphersal --graph old/
# or serve it to the browser playground
graphersal --graph old/ --server
repair
graphersal store repair <DIR> --to <NEW_DIR> [--drop-damaged-blobs]
Builds a repaired copy of a damaged store in NEW_DIR (never in place; the damaged files are not
changed) and reports what was repaired, lost and diverged. A store of an older released format
(Graphersal 0.1.x) is read as it is; the repaired store has the current format. Exit 0 with ok: all data kept (and what a repair
never carries: not carried: the history before commit N, ... and the store id),
exit 1 when data is lost or diverged (the repaired store is written anyway: read the lists),
exit 2 without --to. The repaired store starts without marks: one mark not carried: name @ commit N line per mark of the damaged store at or before the repaired position. When both
GRAPH copies are damaged, repair and verify print the note lineage before commit N is approximate (both GRAPH copies damaged) (verify then exits 1 with the damage report instead of
"not a store"). See Damage, Maintenance and Repair.
A blob (an embedding model) missing or damaged in DIR is not carried and is reported; the
repaired catalog still references it. Restore it first with restore-blobs,
or give --drop-damaged-blobs: the repaired store leaves out every definition referencing such
a blob (stderr note: left out ... lines; journal blob.dropped). It is refused, with nothing
written (exit 1), while the schema needs one of them (the message names the properties).
restore-blobs
graphersal store restore-blobs <DIR> --from <SOURCE> [--json]
Copies the blobs the store references that are missing or damaged back from
SOURCE: a backup directory (full or incremental), a ZIP backup (.zip), a packed snapshot
(.gsnap) or another store (a directory or .gstore). Each blob is checked (length, CRC-32C,
hash) before it is moved into place; a healthy blob is never touched. The store must be closed
(exit 1 "in use" otherwise). Prints a summary (referenced, missing or damaged, restored,
bytes restored) and one line per blob (restored blob, not in the source, damaged there too); --json prints the report as one JSON object (source,
referenced, wanted, restored, bytesRestored, notFound, damagedInSource,
complete). Exit 0 when every blob the store references is intact afterwards, else 1
with the list.