Import your MySQL database with the pscale CLI
You can now import an existing MySQL database into PlanetScale Vitess with no downtime from the pscale CLI. Connect your database to a production branch as an external keyspace, then move its tables into PlanetScale with a Vitess MoveTables workflow. Your database keeps serving traffic while the data copies and replicates, and you switch reads, then writes, when you're ready.
pscale keyspace create-external mydb main mydb_source \ --host db.example.com \ --source-database mydb \ --username migration_user \ --password <PASSWORD> \ --ssl-mode required \ --wait pscale branch vtctl move-tables create mydb main \ --workflow import_mydb \ --source-keyspace mydb_source \ --target-keyspace mydb \ --all-tables \ --defer-secondary-keys
Follow the import's progress with pscale branch vtctl move-tables status or on the Workflows page in the dashboard.