Skip to main content
PlanetScale workflows are built on top of Vitess VReplication and provide a managed way to move data between database sources with real-time progress tracking, data verification, and controlled traffic switching. There are two types of workflows available:

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 Vitess MoveTables 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.
Table movement workflows can be created from the dashboard, the CLI, or the API.

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:
  1. Copying — Initial data copy from source to target
  2. Running — Real-time replication keeps source and target in sync
  3. Switching traffic — Controlled cutover of replica and primary traffic to the target
  4. Complete — Workflow finalized and source connection closed
For the full list of states specific to table movement workflows, see the Workflow state reference. For import workflow states, see Workflow phases.

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 the pscale 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.

View workflow history

To view the history of all completed or pending workflows, click on Workflows in the left nav. From here, you can see all previous workflows along with information such as status, duration, and the time it took to complete.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.