Skip to main content
The PlanetScale Discovery Tool analyzes your existing PostgreSQL database and cloud infrastructure to help plan your migration to PlanetScale Postgres. It collects metadata about your database configuration, schema structure, performance characteristics, security settings, and cloud resources. It never reads or stores actual table data. The Discovery CLI also supports MySQL and MySQL-compatible database discovery. See the MySQL setup guide for MySQL, Vitess, and PlanetScale-specific details. The tool produces a structured JSON report that PlanetScale uses to provide migration guidance tailored to your environment. You can upload this report to our migration assessment tool for instant feedback on your migration readiness.
The discovery tool is open source and available on GitHub. Essential setup steps are below. Advanced usage, troubleshooting, and detailed reference are available in the full documentation.

What it discovers

Database analysis:
  • PostgreSQL version, configuration, and installed extensions
  • Schema structure, including schemas, tables, columns, indexes, constraints, and sizes
  • Performance statistics such as cache hit ratios, table/index usage, and active locks
  • Security configuration: roles, permissions, and SSL settings
  • Feature usage: foreign data wrappers, partitioning, PostGIS, and more
Cloud infrastructure analysis:
  • Database instances, clusters, and their configurations
  • Supabase, Heroku Postgres, and Neon project metadata
  • VPC networking, subnets, security groups, and firewall rules
  • Performance metrics from cloud monitoring services
  • High availability and replica configurations

Installation

The discovery tool requires Python 3.10 or later.
1

Download and extract

Download the latest release from GitHub and extract it:
2

Run setup

The setup script verifies your Python version, creates a virtual environment, installs dependencies, and writes a starter config.yaml:
3

Configure credentials

Edit the generated configuration file to include your database and cloud provider credentials:
At a minimum, configure your database connection. See Configuration below for the full format.
For advanced installation options, see the Discovery Tool README.

Database user setup

Create a dedicated read-only user for the discovery tool. Connect to your PostgreSQL database as a superuser or privileged role and run the following:
If your database has additional schemas beyond public, repeat the GRANT USAGE ON SCHEMA and GRANT SELECT ON ALL TABLES IN SCHEMA statements for each schema you want analyzed.

PostgreSQL cleanup

After PostgreSQL discovery is complete, remove the planetscale_discovery user from your database. This user has read access to your schema and system catalogs and should not be left in place.
If the user owns any objects, reassign ownership first:

Configuration

The discovery tool uses a YAML configuration file. Running ./ps-discovery loads ./config.yaml by default. Configure the database block for database discovery and enable any cloud providers you want included:

Running discovery

Run discovery with the generated config.yaml:
Or point to a specific config file:
The tool produces a timestamped JSON file in your configured output directory, such as planetscale_discovery_results_20260708T072229.json. Upload this report to the migration assessment tool for instant feedback, or share it with PlanetScale for migration planning assistance.
Once PostgreSQL discovery is complete, remember to clean up the planetscale_discovery user you created on your source database.

Cloud provider setup

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. For third-party hosted Postgres providers, the discovery tool supports Supabase, Heroku, and Neon.

AWS (RDS / Aurora)

The tool discovers RDS instances, Aurora clusters, VPC networking, security groups, and CloudWatch metrics. Authentication (choose one):
  • IAM instance profile (recommended when running on EC2)
  • Access key and secret key
  • IAM role assumption (for cross-account access)
Required permissions:
  • RDS: DescribeDBInstances, DescribeDBClusters, DescribeDBSubnetGroups
  • EC2: DescribeVpcs, DescribeSubnets, DescribeSecurityGroups, DescribeRouteTables
  • CloudWatch: GetMetricStatistics, ListMetrics
Configuration:

Google Cloud (Cloud SQL / AlloyDB)

The tool discovers Cloud SQL instances, AlloyDB clusters, VPC networks, firewall rules, and Cloud Monitoring metrics. Authentication (choose one):
  • Application Default Credentials (recommended)
  • Service account key file
Required APIs (must be enabled in your project):
  • Cloud SQL Admin API
  • Compute Engine API
  • Cloud Monitoring API
  • AlloyDB API (if using AlloyDB)
Configuration:

Supabase

The tool discovers project metadata, database configuration, PgBouncer settings, and connection details. Authentication: Configuration:

Neon

The tool discovers Neon project metadata, branch topology, compute endpoints, autoscaling configuration, connection pooling, and database names. Authentication:
  • API key from Neon. See Manage API keys in the Neon docs.
  • Or the NEON_API_KEY environment variable
Configuration:

Heroku

The tool discovers Heroku Postgres add-ons across all your apps, including plan details, database sizes, replica configurations, and connection pooling. Authentication: Configuration:

Performance and safety

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 optional data size analyzer performs sampling queries against actual tables and can have a significant performance impact on large databases. If you need this analysis, consider running it against a read replica and starting with a low sampling percentage. This analyzer is disabled by default and must be explicitly opted into via configuration.

Privacy and security

The discovery tool runs entirely on your infrastructure. No data is sent to external services during analysis. Collected: Schema metadata, database configuration, usage statistics, infrastructure topology, and role names. Not collected: Table contents, row data, application queries, passwords, or secrets. Passwords are used only to establish the database connection and are never included in the output.

Get an instant migration assessment

Once you have your discovery report, upload it to our migration assessment tool for immediate feedback. The tool analyzes your report and provides:
  • An overview of your existing database and optionally hosting provider
  • Extension compatibility issues, schema defects, and any migration blockers
  • A recommended migration path with main steps involved and the estimated duration
All analysis happens client-side in your browser — your discovery data is never sent to a server.

Next steps

If you want tailored guidance from our migration team, share your discovery report with us. You can also follow one of our migration guides on your own:

Migrate using pgdump/restore

Migrate using WAL streaming

Migrate using Amazon DMS

Migrate from Heroku

Need help?

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