Skip to content

Releases

v0.2.0 — back up any LMDB environment

Choose a tag to compare

@dhivadhiva dhivadhiva released this 09 Oct 19:21

v0.2.0 — back up any LMDB environment

lmdb-lws-backup now takes encrypted hot backups of any LMDB environment, not just monero-lws. Existing v0.1 deployments keep working unchanged: default filenames, manifests, and verify behavior are fully backward compatible.

New

  • Profiles ([source] profile / --profile): auto (default) detects the monero-lws accounts table in the snapshot and keeps v0.1 behavior for monero-lws databases; monero-lws is strict (verify fails if the accounts table is missing); generic is fully schema-blind for arbitrary LMDB databases.
  • Generic verification: every named table is decrypted into RAM and walked in full; plain key/value rows in the unnamed main DB are supported, so single-file and main-DB-only environments back up and verify cleanly. Generic manifests record table_count and total_rows instead of account data.
  • [backup] filename_prefix: backups are named <prefix>-YYYYMMDD.lmdbbak.enc with prefix-scoped retention, so multiple databases can share one destination directory. Default remains lws-backup.
  • [source] max_named_dbs (1–4096) with adaptive reopening for environments with many named tables.
  • data.mdb path guard: a db_path pointing at a data.mdb file with a sibling lock.mdb is treated as its parent directory environment — opening the file directly would coordinate through a separate data.mdb-lock the live writer never reads, risking a torn snapshot. If both lock.mdb and data.mdb-lock exist, the layout is ambiguous and the tool refuses to open rather than guess.

Fixed

  • A failed restore (e.g. a forced-profile mismatch detected after decryption) now removes the decrypted data.mdb again instead of leaving plaintext behind and blocking a corrected retry.

Unchanged guarantees

Read-only MVCC snapshots that never block or resize the live database; plaintext never touches persistent storage (pipe-streamed encryption, memfd verification); a failed copy can never produce a file that passes verification; retention never deletes the newest N backups.

Asset

lmdb-lws-backup-0.2.0-linux-x86_64 — stripped Release build, dynamically linked against glibc only (LMDB and libsodium statically linked). Verify with SHA256SUMS. Building from source: see the README.

Guide: lmdb-lws-backup on learn.dhivalabs.com: install steps, a beginner guide and troubleshooting.