anyback
anyback is a command-line tool for backing up and restoring Anytype spaces.
See anyback.1.md for detailed CLI documentation.
Alpha Release
- This is an alpha version - Testing is still in progress. If you're adventurous, please give it a try. File any issues on github.
Features
- Backup Anytype spaces (full or selective)
- incremental backup using
--since(timestamp) - selective backup using
--objects(object list) - optional:
--include-files,--include-nested,--include-archived
- incremental backup using
- Restore backups to original or new space
- optional
--replaceto overwrite existing objects --dry-runto validate without importing
- optional
- Browse archives with an interactive TUI (
inspect)- view object properties, metadata, and markdown preview
- export files and simplified object markdown
- configurable preview cache budget with
--max-cache(default200 MiB)
- List archive contents, compare archives, extract objects
Commands
anyback backup --space NAME_OR_ID [OPTIONS]
anyback restore ARCHIVE --space NAME_OR_ID [OPTIONS]
anyback list ARCHIVE [--brief|--expanded|--files]
anyback manifest ARCHIVE
anyback diff ARCHIVE1 ARCHIVE2
anyback extract ARCHIVE ID OUTPUT
anyback inspect ARCHIVE [--max-cache SIZE]
anyback auth ...
export and import are aliases for backup and restore.
Usage Notes
- Object lists:
--objects FILEreads one object ID per line (blank lines and#comments ignored). Use--objects -for stdin. - Backup output:
--dir DIRcreates a timestamped archive in an existing directory.--dest PATHcreates an archive at a specific path.--prefix PREFIXsets the archive name prefix (with--diror default.).- Backup produces
.ziparchives.
- Import modes:
--import-mode ignore-errors(default): continue after errors.--import-mode all-or-nothing: stop on first error (not transactional; already-imported objects are not rolled back).
- Restore reports:
--log REPORT.jsonwrites a JSON report with success/failure details. - Archive formats:
list,diff,inspect, andrestoreaccept both.ziparchives and unpacked archive directories. - Manifest: anyback writes manifest metadata to
<archive>.manifest.json. Archives without manifests (e.g. desktop-generated backups) are still supported.
Development
Library Crate
This package also exposes a reusable Rust library crate, anyback_reader, for archive traversal and snapshot file inspection. Library consumers can use default-features = false to exclude CLI-only dependencies.
Restore Transport
- Default restore transport is path-based (
PbParams.path). - Snapshot transport is compiled behind the opt-in
snapshot-importcargo feature and used for selective restore (--objects). - Snapshot transport supports
*.pbarchives;*.pb.jsonrestore is not yet supported. - Snapshot chunk limits (env overrides):
ANYBACK_IMPORT_MAX_SINGLE_SNAPSHOT_BYTES(default 2 MiB)ANYBACK_IMPORT_MAX_BATCH_BYTES(default 3 MiB)ANYBACK_IMPORT_MAX_BATCH_SNAPSHOTS(default 128)
Integrity Testing
Fuzz testing for backup/restore roundtrips:
cargo test -p anyback --test integrity_nightly -- --ignored --nocapture
Environment controls:
| Variable | Example values |
|---|---|
ANYBACK_INTEGRITY_PROFILE |
tiny, small, medium, large |
ANYBACK_INTEGRITY_ITERATIONS |
number of iterations |
ANYBACK_INTEGRITY_MAX_OBJECTS_PER_ITERATION |
max objects per iteration |
ANYBACK_INTEGRITY_MAX_BODY_BYTES |
max body bytes per object |
ANYBACK_INTEGRITY_MAX_SECONDS |
time limit |
ANYBACK_INTEGRITY_MAX_TOTAL_OBJECTS |
total object cap |
ANYBACK_INTEGRITY_MAX_TOTAL_BODY_BYTES |
total byte cap |
ANYBACK_INTEGRITY_SEED |
RNG seed for reproducibility |
ANYBACK_INTEGRITY_TYPES |
page,note,task,... |
ANYBACK_INTEGRITY_FORMAT |
pb or pb-json |