๐ Quick Start
Back up your first database to BackupData.io in about five minutes. You will:
- Sign in and get your free workspace
- Create an API key
- Install and authenticate
- Create a database dump
- Upload it as a snapshot
- Verify the snapshot
- What's next?
This quick start uses PostgreSQL as the example. Every other database follows the same shape โ only step 4 changes.
1. Sign in and get your free workspaceโ
Open app.backupdata.io and sign in with email + password, Google, or a wallet (SIWE). All three produce the same account.
Your free workspace is provisioned automatically โ no setup, no payment. Open Workspaces in the sidebar and copy the Workspace ID, a UUID like 550e8400-e29b-41d4-a716-446655440000. You will need it in step 3.
Every new account includes a free workspace with 5 GB of storage. Past 5 GB, upgrade before retaining more backup data โ see pricing.
2. Create an API keyโ
This is the credential your backups authenticate with.
- Sidebar โ API Keys โ Create New API Key.
- Key Name โ e.g.
quickstart. - Workspace โ the workspace from step 1.
- Scopes โ tick
backup:write,backup:read, andsnapshots:read. That is everything this quick start needs. - Click Create API Key.
Copy the raw lh_โฆ key (or click Download .txt) before closing the dialog. Afterwards only its prefix is visible, and a lost key must be revoked and replaced โ keys are immutable and cannot be re-scoped.
3. Install and authenticateโ
- CLI
- Go SDK
- JS SDK
npm install -g @lighthouse-web3/baas-js-sdk
Log in with the key from step 2 and select your workspace:
baas auth login --api-key # paste the lh_โฆ key when prompted
baas workspace use <workspaceId>
baas auth whoami # confirms identity and active workspace
For cron or CI, skip the interactive login and set the environment directly:
export BAAS_API_KEY="lh_xxxxxxxxxxxxxxxxxxxxxxxx"
export BAAS_WORKSPACE_ID="550e8400-e29b-41d4-a716-446655440000"
Requires Go 1.24+:
go get github.com/lighthouse-web3/baas-go-sdk@latest
export BD_API_KEY="lh_xxxxxxxxxxxxxxxxxxxxxxxx"
export BD_WORKSPACE_ID="550e8400-e29b-41d4-a716-446655440000"
Requires Node.js 18+:
npm install @lighthouse-web3/baas-js-sdk
export BD_API_KEY="lh_xxxxxxxxxxxxxxxxxxxxxxxx"
export BD_WORKSPACE_ID="550e8400-e29b-41d4-a716-446655440000"
The portal you clicked around in is app.backupdata.io. The API is api.backupdata.io โ that is the value the Go SDK needs for APIURL. The CLI and JS SDK target it internally.
4. Create a database dumpโ
Write the dump into a dedicated directory. BackupData.io uploads the directory, so this is what becomes your snapshot:
mkdir -p ./db-dumps
export PGPASSWORD='your_password'
pg_dump \
--host=127.0.0.1 \
--port=5432 \
--username=postgres \
--format=custom \
--file=./db-dumps/app.dump \
app_db
Overwrite the same file on every run rather than adding a timestamp. Backups are content-addressed and incremental, so a stable path means each run uploads only what actually changed โ while still producing a fresh, complete restore point.
Backing up something else? The command is the only difference: MySQL, SQLite, MongoDB, DynamoDB, Amazon S3, or the quick reference.
5. Upload it as a snapshotโ
- CLI
- Go SDK
- JS SDK
baas backup ./db-dumps --description "first backup" --tag env=dev
package main
import (
"log"
"os"
sdkclient "github.com/lighthouse-web3/baas-go-sdk/client"
sdktypes "github.com/lighthouse-web3/baas-go-sdk/types"
)
func main() {
client, err := sdkclient.NewBackupClient(sdkclient.BackupClientOptions{
APIURL: "https://api.backupdata.io", // API host, not the portal
APIKey: os.Getenv("BD_API_KEY"),
WorkspaceID: os.Getenv("BD_WORKSPACE_ID"),
})
if err != nil {
log.Fatalf("client init: %v", err)
}
snapshot, err := client.Backup([]string{"./db-dumps"}, &sdktypes.BackupOptions{
Description: "first backup",
Tags: map[string]string{"env": "dev"},
})
if err != nil {
log.Fatal(err)
}
log.Printf("snapshotId=%s size=%d chunks=%d",
snapshot.SnapshotID, snapshot.TotalSize, snapshot.TotalChunks)
}
Run it from the directory containing db-dumps:
go run .
import { BackupClient } from "@lighthouse-web3/baas-js-sdk";
const client = new BackupClient({
apiKey: process.env.BD_API_KEY,
workspaceId: process.env.BD_WORKSPACE_ID,
});
const snapshot = await client.backup(["./db-dumps"], {
description: "first backup",
tags: { env: "dev" },
});
console.log(
`snapshotId=${snapshot.snapshotId} size=${snapshot.totalSize} chunks=${snapshot.totalChunks}`,
);
Save as upload.mjs and run it from the directory containing db-dumps:
node upload.mjs
The upload runs the full pipeline in one call โ scan, chunk, deduplicate, compress, upload, then create the snapshot. It prints a snapshot ID; that is your restore point.
6. Verify the snapshotโ
- CLI
- Go SDK
- JS SDK
baas snapshot list --limit 5
resp, err := client.ListSnapshots("", 5) // cursor, limit
if err != nil {
log.Fatal(err)
}
for _, s := range resp.Snapshots {
log.Printf("id=%s desc=%s size=%d", s.SnapshotID, s.Description, s.TotalSize)
}
const resp = await client.listSnapshots("", 5); // cursor, limit
for (const s of resp.snapshots) {
console.log(`id=${s.snapshotId} desc=${s.description} size=${s.totalSize}`);
}
You can also see it in the portal: Backup Sources โ your source โ the new snapshot is at the top, with its size, chunk count, and paths.
Prove it round-trips before you rely on it. Restore into a scratch directory โ never over live data โ and check the contents:
baas restore <snapshotId> ./restore-check
find ./restore-check -type f -print
Then load ./restore-check/db-dumps/app.dump into a throwaway database with pg_restore. Full walkthrough: recovery drill.
7. What's next?โ
- ๐ค Automated backup with scheduling โ turn this into a nightly cron or systemd job with a retention policy
- ๐ธ Upload & manage snapshots โ list, inspect, prune, delete, restore, and client-side encryption
- ๐๏ธ API Keys โ scoping and rotation for automation
- ๐ข Workspaces and members โ share a workspace with your team
- ๐ฉบ Troubleshooting โ common errors and fixes