Move tables to another keyspace

sharding & workflows

// what it does

Starts a Vitess MoveTables workflow: copies the named tables from one keyspace to another while replication keeps them in sync with live writes. This is the online, reversible mechanism for moving hot tables into a sharded keyspace.

// shell

$ pscale workflow create mydb main --name move-events --source-keyspace mydb --target-keyspace sharded-ks --tables events,event_properties

// gotcha

--on-ddl defaults to STOP, pausing the workflow if someone ships a schema change to a moving table mid-flight — coordinate schema freezes with your team. Tables with AUTO_INCREMENT need --global-keyspace for sequence tables.

// resources