Tutorials overview
These tutorials are end-to-end backup recipes. Each one walks through producing a consistent dump of a specific database, verifying it, optionally restoring it, and uploading it to Lighthouse. Use the scheduling guide after the one-off flow works.
How the tutorials fit togetherโ
Every database backup follows the same two-stage shape:
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Stage 1 โ Create a dump โ โโโถ โ Stage 2 โ Upload snapshot โ
โ (per-database guide) โ โ (per-database guide) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
app.dump / app.sql ./db-dumps โโโถ snapshot
- Stage 1 is database-specific. Pick your database below.
- Stage 2 uses the same minimal backup operation in every database tutorial (
Backup()in Go,backup()in JS, orbaas backupin the CLI). - Scheduling is optional. When you are ready, use Automated backup with scheduling to wrap the dump and upload in cron or a systemd timer.
All dumps land in a single ./db-dumps directory using a stable filename that you overwrite each run. The SDK then uploads that directory as an incremental snapshot.
Pick your databaseโ
| Database | Dump tool | Guide |
|---|---|---|
| ๐ PostgreSQL | pg_dump | PostgreSQL |
| ๐ฌ MySQL / MariaDB | mysqldump | MySQL |
| ๐ชถ SQLite | sqlite3 .backup | SQLite |
| ๐ MongoDB | mongodump | MongoDB |
| โก Amazon DynamoDB | aws dynamodb | Amazon DynamoDB |
| ๐ชฃ Amazon S3 | aws s3 sync | Amazon S3 |
Then automate itโ
Once you can produce a dump by hand, wire it into the scheduled job:
โก๏ธ Automated backup with scheduling โ a dump script + SDK uploader + cron/systemd timer for a nightly backup.
Before you startโ
You'll need (once):
-
A Lighthouse account and workspace โ Web Portal & Free Workspace.
-
An API key scoped
backup:write,backup:read,snapshots:readโ API Keys. -
A BaaS client installed (for the upload step):
- Go SDK
- JS SDK
- CLI
go get github.com/lighthouse-web3/baas-go-sdk@latestnpm install @lighthouse-web3/baas-js-sdknpm install -g @lighthouse-web3/baas-js-sdk
baas --help
Export your credentials so every tutorial can reuse them:
export LH_API_KEY="lh_xxxxxxxxxxxxxxxxxxxxxxxx"
export LH_WORKSPACE_ID="550e8400-e29b-41d4-a716-446655440000"
For the CLI, use the same values with its environment variable names:
export BAAS_API_KEY="$LH_API_KEY"
export BAAS_WORKSPACE_ID="$LH_WORKSPACE_ID"