Skip to main content

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 Go SDK Backup() call in every database tutorial.
  • 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โ€‹

DatabaseDump toolGuide
๐Ÿ˜ PostgreSQLpg_dumpPostgreSQL
๐Ÿฌ MySQL / MariaDBmysqldumpMySQL
๐Ÿชถ SQLitesqlite3 .backupSQLite
๐Ÿƒ MongoDBmongodumpMongoDB
โšก Amazon DynamoDBaws dynamodbAmazon DynamoDB
๐Ÿชฃ Amazon S3aws s3 syncAmazon 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):

  1. A Lighthouse account and workspace โ€” Web Portal & Free Workspace.

  2. An API key scoped backup:write, backup:read, snapshots:read โ€” API Keys.

  3. The BaaS Go SDK installed (for the upload step):

    go get github.com/lighthouse-web3/baas-go-sdk@latest

Export your credentials so every tutorial can reuse them:

export LH_API_KEY="lh_xxxxxxxxxxxxxxxxxxxxxxxx"
export LH_WORKSPACE_ID="550e8400-e29b-41d4-a716-446655440000"