Table movement
Move tables between keyspaces within your PlanetScale database. Used for sharding, resharding, and reorganizing data.
Database import
Import data from an external MySQL or MariaDB database into PlanetScale with no downtime.
Table movement workflows
Table movement workflows let you move tables from one keyspace to another within your PlanetScale database. If you are familiar with Vitess, these are analogous to the VitessMoveTables workflow.
Available table movement workflows:
- 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.
Database import workflows
Database import workflows let you migrate data from an external internet-accessible MySQL or MariaDB database into PlanetScale with no downtime. The import workflow handles connection setup, schema validation, data copying, real-time replication, and controlled traffic switching. Database import workflows are created through the PlanetScale dashboard. To get started, go to New database > Import database. For a full walkthrough, see the Database imports documentation.Shared workflow lifecycle
Both workflow types follow a similar lifecycle:- Copying — Initial data copy from source to target
- Running — Real-time replication keeps source and target in sync
- Switching traffic — Controlled cutover of replica and primary traffic to the target
- Complete — Workflow finalized and source connection closed
Create a workflow
To create a new workflow, select your database and click Workflows in the left nav, then click New workflow. You’ll be prompted to choose between moving tables between keyspaces or importing from an external database. You can also create table movement workflows using thepscale workflow create CLI command or the Create workflow API endpoint.
Database import workflows can only be created through the PlanetScale dashboard. The CLI and API
create commands are for table movement workflows only. Once created, all other workflow lifecycle commands (switch-traffic, verify-data, complete, cancel, etc.) work with both workflow types.
