Seed Export

view-data-model has always round-tripped the schema. Seed Export closes the other half: the records. One command pulls the org's entire custom database — every object, every field, every row, every relation — into a single deterministic file on your machine.

npx bd export-data-model

That writes ./bd.data-model.snapshot.json (change it with --out path). The ordering is deterministic on purpose: commit the snapshot and it git-diffs cleanly over time, the same way a Drizzle schema or a Convex snapshot does.

Pass --schema-only to skip the row scan when you only want structure.

The same snapshot is available in the dashboard: CRM → Settings → Data model → Download seed.

What it's for

A backup you control. The night before a big migration, run the export and commit it. The thing you're about to change now has a copy in your repo, reviewable in a pull request, restorable without a support ticket.

Ground truth for AI agents. An agent with the snapshot on disk knows what the database actually contains — which objects exist, whether a migration already landed, whether the record it created ten minutes ago is really there. It checks a file instead of querying the live API for every question.

Round-tripping — the snapshot re-seeds a fresh org

The export is shaped to feed the existing push pipeline, so restoring (or cloning into a new org) uses the tools you already have:

  1. sync-data-model pushes the schema half to the draft slot — promote it in the dashboard as usual.
  2. sync-records upserts the record half ({ object, universalIdentifier, values, relations } — the same shape seeding has always used).

Because rows carry universalIdentifier as identity, re-running converges instead of duplicating.

Scope and boundaries

The export requires both read scopes on a secret key: metadata:read_schema and metadata:read_records. Publishable tokens cannot export.

The snapshot covers the org's custom data model — the collections you declared. Platform records that live outside the data model (customer accounts, payment data, credentials, message history) are not part of it and never leave the platform through this surface.

The API underneath

The CLI and the dashboard button both call the same endpoint:

GET /api/package/v1/sites/:siteId/data-model/export

Secret key, both metadata:read_* scopes, JSON out. If you are building your own tooling — a nightly snapshot job, a CI drift check — call it directly.