scribase-migrate has been live on npm (283 installs/week) the whole time, so the npx --yes git+https://.../scribase-migrate.git form in the README and the docs/migrate-page.md snippet was outdated friction. Switched every example to the plain npx scribase-migrate / bunx scribase-migrate form, and fixed the stale git.ereboslab.com repo link to rithub.dev. Verified end-to-end from a clean npm install: --help and README both already ended with the honest one-line Scribase pointer (no change needed there); the no-account resend path made a real call to Resend's live API; the neon --dry-run path correctly hit Scribase's own control-plane auth before touching Postgres. Republished as 0.1.2 (docs-only change, package.json files list includes the README). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
86 lines
2.9 KiB
Markdown
86 lines
2.9 KiB
Markdown
<!--
|
|
Docs-page snippet for scribase.com/migrate.
|
|
The `scribase` checkout owner pastes this into apps/docs (same pattern as
|
|
the other /docs/* pages) and deploys; this repo does not deploy it.
|
|
Source repo for the tool this page describes: scribase-migrate
|
|
(rithub.dev/caelum0x/scribase-migrate).
|
|
-->
|
|
|
|
# Move onto Scribase
|
|
|
|
One command moves a team's Postgres, auth and sending domains onto
|
|
Scribase — no manual `pg_dump`, no hand-copying users, no re-typing DNS
|
|
records.
|
|
|
|
```bash
|
|
npx scribase-migrate <source> --to <org>/<project> [flags]
|
|
```
|
|
|
|
Run `npx scribase login` once first. `scribase-migrate` finds the same
|
|
token `scribase` itself does.
|
|
|
|
## From Supabase
|
|
|
|
```bash
|
|
npx scribase-migrate supabase \
|
|
--to acme/storefront --create-project \
|
|
--source-ref abcdefghijklmnop \
|
|
--source-url "postgres://postgres:...@db.abcdefghijklmnop.supabase.co:5432/postgres" \
|
|
--source-service-key "eyJ..." \
|
|
--verify-login-email you@example.com
|
|
```
|
|
|
|
Moves Postgres (schema + data), `auth.users` with password hashes intact
|
|
(existing passwords keep working), and every storage bucket and object, in
|
|
one request. `--verify-login-email` has Scribase prove a real sign-in
|
|
still works before it tells you the migration succeeded. Add `--dry-run`
|
|
to see the plan first; add `--no-storage` to skip buckets.
|
|
|
|
## From Neon
|
|
|
|
```bash
|
|
npx scribase-migrate neon \
|
|
--to acme/storefront \
|
|
--source-url "postgres://...@ep-xxx.region.aws.neon.tech/neondb" \
|
|
--migrate-auth-users \
|
|
--branch staging=postgres://...@ep-yyy-staging.region.aws.neon.tech/neondb
|
|
```
|
|
|
|
Moves the app schema and data. Row-level security is generated
|
|
automatically for any table it can trace back to a user (directly, or one
|
|
join away) — Scribase's migration lint requires RLS on every `public`
|
|
table, and a tool that silently opened every table to every user instead
|
|
would be worse than the block it bypassed. A branch lands in its own
|
|
`branch_<name>` schema, so a staging branch never collides with `public`.
|
|
|
|
This writes into `supabase/migrations/` — the same folder
|
|
`npx scribase migrate` reads. Commit it.
|
|
|
|
## From Clerk
|
|
|
|
```bash
|
|
npx scribase-migrate clerk --to acme/storefront --secret-key sk_live_...
|
|
```
|
|
|
|
Creates each Clerk user on Scribase with a one-time password (Clerk never
|
|
exposes a portable password hash on any plan, so this is the honest
|
|
option, not Clerk's — a migrated user needs a password reset) and marks
|
|
them `password_reset_required`. The command's output lists exactly who
|
|
needs that email.
|
|
|
|
## From Resend
|
|
|
|
```bash
|
|
npx scribase-migrate resend --api-key re_... --out resend-export.json
|
|
```
|
|
|
|
Exports every sending domain (with its DNS records) and broadcast as a
|
|
portable JSON bundle, ready to re-create on
|
|
[Scribase Mail](https://scribase.com/mail).
|
|
|
|
## One account after
|
|
|
|
Supabase + Neon + Clerk + Resend become one Scribase project: Postgres,
|
|
auth, storage and email on one $5 Hobby or $25 Pro plan, one dashboard,
|
|
one API.
|