checkpoint
Writes a consistent copy of this database into target, which must be empty or absent.
val info = db.checkpoint(Path.of("backup", "2026-08-10"))
Rabosh.open(info.directory).use { copy -> /* every commit up to info.sequence, indexes and all */}Safe to call while the application is writing, which is the whole reason it exists: the recipe it replaces is stop writing and copy the directory, and a desktop application cannot stop writing because it is the writer. The database is flushed, a snapshot is pinned, and the copy is of what that snapshot sees — so the result holds exactly the acknowledged prefix as of CheckpointInfo.sequence. Anything committed during the call is above that sequence and is simply not in the copy.
Everything travels, and the sidecars are read rather than rebuilt. Segments carry their .cat, .idx, .pst and .col files with them, and this method adds the one file DocumentStore.checkpoint cannot know about — INDEXES, the index registry, which is a definition an operator gave rather than derived data. Losing it would leave the copy silently without an index somebody created, so it is copied here and the layer that owns it does the writing.
A checkpoint, not a backup tool. No scheduling, no retention, no incremental mode, no compression. And the files are hard-linked where the filesystem allows it — see CheckpointInfo.hardLinked — so the result shares its blocks with the source: taking it somewhere else is what turns a consistent view into a backup, and that step is yours.
Throws
if target exists and is not an empty directory.
if this database is closed.