Skip to main content

Snapshots & restore

Snapshots are created/restored by the LioranManager.

manager.snapshot(snapshotPath)

Creates a tar.gz archive of the manager root directory.

import { LioranManager } from "@liorandb/core";

const manager = new LioranManager({ rootPath: "./data" });
await manager.db("app"); // open something (optional)

await manager.snapshot("./backups/app.tar.gz");
await manager.close();

manager.restore(snapshotPath)

Restores a snapshot archive into the manager root directory.

Important behavior:

  • The root directory is removed and recreated.
  • After restore completes, the process prints "Restore completed. Restart required." and exits.