Assess your MySQL, MariaDB, or Vitess database and cloud infrastructure before migrating to PlanetScale Vitess.
The PlanetScale Discovery Tool analyzes your existing MySQL-compatible database and cloud infrastructure to help plan your migration to PlanetScale Vitess. It collects metadata about your database configuration, schema structure, performance characteristics, replication topology, security settings, feature usage, and cloud resources. It never reads or stores actual table data.The Discovery CLI also supports PostgreSQL discovery. See the Postgres Discovery Tool guide for PlanetScale Postgres-specific details.The tool produces a structured JSON report that PlanetScale uses to provide migration guidance tailored to your environment.
The discovery tool is open source and available on GitHub. The documentation below covers the essentials. See the full documentation in the repository for advanced usage, troubleshooting, and detailed reference.
Download the latest release from GitHub and extract it:
tar -xzf ps-discovery-*.tar.gzcd ps-discovery
2
Run setup
The setup script verifies your Python version, creates a virtual environment, installs dependencies, and prompts you to install MySQL and cloud provider support:
./setup.sh
3
Configure credentials
Copy the sample configuration file and edit it to include your database and cloud provider credentials:
cp sample-config.yaml config.yaml
At a minimum, you need to configure your MySQL connection. See Configuration below for the full format.
Alternatively, you can install with pipx for a cleaner setup:
# Install with MySQL supportpipx install -e ".[mysql]"# Or install with MySQL, AWS, and GCP supportpipx install -e ".[mysql,aws,gcp]"
Create a dedicated read-only user for the discovery tool. Connect to your MySQL-compatible database as a privileged user and run the following:
-- Create a dedicated user for database discoveryCREATE USER 'planetscale_discovery'@'%' IDENTIFIED BY 'secure_password_here';-- Grant read access for schema analysisGRANT SELECT ON *.* TO 'planetscale_discovery'@'%';-- Grant process privilege for performance analysis and SHOW PROCESSLISTGRANT PROCESS ON *.* TO 'planetscale_discovery'@'%';-- Grant replication client for binary log and replica status analysisGRANT REPLICATION CLIENT ON *.* TO 'planetscale_discovery'@'%';-- Apply changesFLUSH PRIVILEGES;
On Amazon RDS, Aurora MySQL, Google Cloud SQL for MySQL, MariaDB, and Percona Server, create the user through your administrative database user. Some managed services restrict access to certain system tables. The discovery tool reports those gaps and continues with the data it can collect.
For PlanetScale databases, your existing branch credentials are sufficient. The discovery tool automatically detects PlanetScale and Vitess environments and adapts its queries.
After MySQL discovery is complete, remove the planetscale_discovery user from your database. This user has read access to your schema and system metadata and should not be left in place.
./ps-discovery database --engine mysql --config config.yaml
Run both database and cloud analysis:
./ps-discovery both --engine mysql --config config.yaml
Run only specific MySQL analyzers:
# Schema and features only./ps-discovery database --engine mysql --config config.yaml \ --analyzers schema,features# Performance and replication only./ps-discovery database --engine mysql --config config.yaml \ --analyzers performance,replication
Available MySQL analyzers are config, schema, performance, replication, security, and features.The tool produces a planetscale_discovery_results.json file in your configured output directory. Share this report with PlanetScale for migration planning assistance.
Once MySQL discovery is complete, remember to clean up the planetscale_discovery user you created on your source database.
Each cloud provider requires specific credentials and permissions. Below is a summary of what you need for each. For detailed instructions including IAM policies and API enablement steps, see the provider documentation.
The default database analyzers are safe to run against production databases. They use read-only queries against system catalogs and statistics views, with very low performance impact.
The discovery tool can query metadata and statistics across every accessible database when the database field is empty. For environments with many databases or very large schemas, consider targeting one database at a time or running the tool against a replica.
The discovery tool runs entirely on your infrastructure. No data is sent to external services during analysis.Collected: Schema metadata, database configuration, usage statistics, replication metadata, infrastructure topology, aggregate security information, and feature usage.Not collected: Table contents, row data, query text, slow query log entries, passwords, secrets, connection strings, application code, or individual grant details. Passwords are used only to establish the database connection and are never included in the output.
Once you have your discovery report, share it with us if you want tailored migration guidance. You can also follow one of our migration guides on your own: