sluice

Move a PlanetScale database to another organization

PlanetScale has no in-place org transfer — its documented path is an offline dump and restore. sluice turns the same move into a zero-downtime sync, and lets you change region or cluster size in the same pass.

Databases belong to an organization at creation, and there is no in-place transfer between organizations — moving one means creating a new database in the target org and copying the data across. To sluice, an org move and a region move are the same operation: both ends connect through the same global host and PlanetScale routes by credential, so sluice never sees the organization at all. Every case, gotcha, and command in the region-move guide applies verbatim here. This page covers only what an org move adds: choosing between the dump path and a live copy, credentials that come from two different orgs, and the org-level settings that don't travel with the data.

Choose your path #

Three ways to make the move:

One thing both sluice paths give you that the dump path can't: the target is an ordinary new database, so you can change region and/or cluster size in the same move — pick the new org's region and tier when you create it, and the copy lands there directly.

Credentials from two orgs — the one mechanical difference #

The source password is minted in the source org and the target password in the target org — pass --org to each pscale call rather than relying on the CLI's default org:

# source org: read access is enough
pscale password create app main mover --org source-org

# target org: sluice creates tables (and, for a sync, control tables) -> --role admin
pscale password create app main mover --role admin --org target-org

USERNAME is the generated username field each command returns — not the label — and PASSWORD its plain_text value. Both DSNs point at the same global host; the credential alone decides which org (and database) you reach:

# source (org A) — export as SLUICE_SOURCE
USERNAME:PASSWORD@tcp(aws.connect.psdb.cloud:3306)/app?tls=true

# target (org B) — export as SLUICE_TARGET
USERNAME:PASSWORD@tcp(aws.connect.psdb.cloud:3306)/app?tls=true

The two databases can share a name — names are scoped per organization, so app in the source org and app in the target org are distinct databases and the DSNs above are unambiguous. Prefer environment variables over putting DSNs in argv, and use --source-driver planetscale --target-driver planetscale on both ends exactly as in the region-move guide.

Settings don't travel — the re-apply checklist #

The copy moves your schema and rows. Everything configured on the database or the organization stays behind, and the new database starts from defaults in the new org:

The copy itself — follow the region-move guide #

With the two DSNs in SLUICE_SOURCE / SLUICE_TARGET, the move is byte-for-byte the region-move flow: Case 1 for a single unsharded database (the common one), Case 2 for several databases (one run per keyspace, or a fleet config), Case 3 for a sharded keyspace. All the gotchas carry over too — --upfront-indexes on large tables, --apply-batch-size in the 25–50 range, waiting for caught-up before cutover. The zero-downtime shape, for orientation:

sluice sync start --stream-id org-move \
    --source-driver planetscale --source "$SLUICE_SOURCE" \
    --target-driver planetscale --target "$SLUICE_TARGET" \
    --apply-batch-size 50

# ... watch sync status / sync health until caught up, then:
sluice cutover \
    --source-driver planetscale --source "$SLUICE_SOURCE" \
    --target-driver planetscale --target "$SLUICE_TARGET"

sluice sync stop --stream-id org-move \
    --target-driver planetscale --target "$SLUICE_TARGET" --wait

sluice verify \
    --source-driver planetscale --source "$SLUICE_SOURCE" \
    --target-driver planetscale --target "$SLUICE_TARGET"

After verify reports a match and the application is writing to the target org, walk the settings checklist above, then wind down the source database on your own schedule — it is untouched by the move and remains your rollback until you delete it.

Next steps #