pscale branch vtctl (or the matching APIs). The dashboard shows the live state of each workflow, read directly from Vitess.
Move tables between keyspaces
Move tables between keyspaces within your PlanetScale database. Used for sharding, resharding, and reorganizing data.
Import a database
Import data from an external MySQL database into PlanetScale with no downtime.
Materialize tables and views
Keep copies, aggregations, or views in sync in near-realtime.
Move tables between keyspaces
Move tables from one keyspace to another within your PlanetScale database:- Unsharded to sharded: Move tables from an unsharded keyspace to a new sharded keyspace. This is the primary way to shard existing tables. See the Sharding quickstart.
- Sharded to sharded: Move tables between sharded keyspaces to change the number of shards. See Modifying the number of shards.
- Unsharded to unsharded: Move tables from one unsharded keyspace to another unsharded keyspace.
Import a database
To import an external internet-accessible MySQL database, you first connect it to your production branch as an external keyspace. Then you run a workflow with the external keyspace as the source and your PlanetScale keyspace as the target. The import copies your data, replicates new changes in real time, and switches traffic to PlanetScale with no downtime. For a full walkthrough, see the Database imports documentation.MoveTables lifecycle
Every MoveTables workflow follows the same lifecycle:- Create:
move-tables createcopies the table schemas to the target keyspace and starts copying rows. - Copy: Vitess copies the existing rows from the source to the target. Streams are
Copying. - Replicate: Once the copy finishes, Vitess keeps the target up to date with every new write on the source. Streams are
Running. - Verify: Optionally compare the source and target with
vdiff. - Switch traffic:
move-tables switch-trafficmoves replica traffic, then primary traffic, to the target keyspace.move-tables reverse-trafficmoves it back. - Complete:
move-tables completestops replication. Its required flags decide whether the moved tables are dropped from the source keyspace and whether the routing rules are removed. You can alsocancela workflow at any point before it is complete.
move-tables status between steps. It shows each table’s copy progress, each stream’s state, and the traffic state. JSON output includes a next_steps field with the command to run next. See the move-tables reference for every command and flag.
Materialize
Materialize keeps target tables in sync in near-realtime. Targets can be copies, aggregations, or views defined by aSELECT against a single source table.
Prefer MoveTables when you only need to move whole tables between keyspaces. Prefer Materialize when the target needs a different schema or a query that filters or aggregates rows.
- Create with
--table-settingsJSON that names each target table and itssource_expression. - Show until streams are replicating.
- Read from the target tables once they are in sync.
- Stop / start to pause and resume, or cancel to tear the workflow down.
materialize reference for flags and examples, and the Vitess Materialize docs for SELECT limitations.
View workflows in the dashboard
Select your database and click Workflows in the left nav. Pick a branch to see MoveTables and Materialize workflows on it, across all keyspaces or filtered to one keyspace. The list shows each workflow’s type. Open a MoveTables workflow to see:- The source and target keyspaces, replication lag, and when the workflow last updated
- Which keyspace is serving reads and writes
- Each stream’s state, rows copied, and any error message
- Each table’s copy progress
- The results of the latest VDiff
pscale branch vtctl move-tables or pscale branch vtctl materialize.
Earlier workflows
Workflows created withpscale workflow create, the earlier dashboard workflow pages, or the /workflows API endpoints are managed separately from MoveTables and Materialize workflows. pscale workflow and the /workflows API endpoints are deprecated. Use pscale branch vtctl move-tables, pscale branch vtctl materialize, and the matching APIs for new work.

