Configuration
Environment variables and storage provider settings.
Unbase reads configuration from environment variables (e.g. a .env in your
working directory). Secrets stay on your machine — nothing is sent anywhere.
Source (Supabase)
| Variable | Required | Description |
|---|---|---|
SUPABASE_DB_URL | yes | Direct or pooler Postgres connection string. |
SUPABASE_SERVICE_KEY | for storage | service_role key (reads private buckets). |
SUPABASE_URL | optional | Project URL; derived from the DB URL if omitted. |
Target database
| Variable | Description |
|---|---|
TARGET_DB_URL / NEON_DB_URL | Target Postgres (load / verify / auth). |
Target storage
Unbase uses one S3 client for every provider, configured with provider-neutral
STORAGE_* names (the legacy CLOUDFLARE_R2_* / NEXT_PUBLIC_R2_URL names are
still accepted):
| Variable | Description |
|---|---|
STORAGE_ACCESS_KEY_ID | Access key. |
STORAGE_SECRET_ACCESS_KEY | Secret key. |
STORAGE_BUCKET | Target bucket. |
STORAGE_ACCOUNT_ID | R2 account id (derives the R2 endpoint). |
STORAGE_ENDPOINT | Explicit endpoint (GCS / MinIO / custom S3). |
STORAGE_REGION | Region (AWS S3). |
STORAGE_FORCE_PATH_STYLE | "true" for MinIO and other path-style hosts. |
STORAGE_PUBLIC_URL | Public base URL objects are served from (used by rewrite). |
Per provider
- Cloudflare R2 — set
STORAGE_ACCOUNT_ID(endpoint is derived). - AWS S3 — set
STORAGE_REGION(e.g.us-east-1). - Google Cloud Storage —
STORAGE_ENDPOINT=https://storage.googleapis.comwith HMAC keys. - MinIO — set
STORAGE_ENDPOINTandSTORAGE_FORCE_PATH_STYLE="true".
Config file
Run unbase init to scaffold an unbase.config.ts describing what to migrate
(secrets stay in .env). It seeds command defaults — CLI flags still override.
/** @type {import("@unbase/core").UnbaseConfig} */
const config = {
schema: "public",
database: true,
createSchema: true, // build the target schema before load
auth: true,
storage: { enabled: true, mirror: true, provider: "r2", keepBucketPrefix: true },
};
export default config;Then preview everything with a dry run:
npx unbase planplan is read-only — it reports config, which env vars are set/missing per target,
the snapshot summary, and the exact phases that would run.
Snapshot location
The IR defaults to ./.unbase/ir. Override per command with --out <dir>, or
point the TUI at one with UNBASE_IR=<dir>.