Skip to content
Home / Migrations / PlanetScaleNeon

PlanetScale Neon

medium

PlanetScale removed its free tier in 2024. Neon offers serverless PostgreSQL with scale-to-zero and database branching. Switching MySQL → PostgreSQL requires schema and query changes.

Estimated: 4-10h · 6 steps
Progress0%
Step 1: Create Neon project

Sign up at neon.tech, create a project. Note your connection string.

Step 2: Export from PlanetScale

Use mysqldump to export your schema and data.

mysqldump -h $PS_HOST -u $PS_USER -p$PS_PASS --no-tablespaces $DB_NAME > dump.sql
Step 3: Convert schema to PostgreSQL

MySQL and PostgreSQL have differences: AUTO_INCREMENT → SERIAL or GENERATED, tinyint(1) → boolean, backtick identifiers → double-quote. Use pgloader for automatic conversion.

pgloader mysql://$PS_CONNECTION_STRING postgresql://$NEON_CONNECTION_STRING
Step 4: Review and fix queries

MySQL-specific SQL: LIMIT x,y → LIMIT y OFFSET x, IFNULL → COALESCE, GROUP BY rules are stricter in PostgreSQL.

Step 5: Update ORM config

If using Prisma: change datasource provider from 'mysql' to 'postgresql'. If Drizzle: switch to drizzle-orm/neon-http.

npm install @neondatabase/serverless
Step 6: Set up branching

Use Neon branches for dev/staging environments — mirrors PlanetScale's branching workflow.

App connects, all queries return correct results
Get started with Neon

What this migration involves

Moving from PlanetScale to Neon is rated medium and takes about 4-10h on a typical project. The guide breaks it into 6 steps, 3 of which ship with runnable commands and 1 with a verification check. On pricing, PlanetScale is freemium and Neon is freemium with a free plan to test the move.

FAQ

How long does migrating from PlanetScale to Neon take?

Around 4-10h for a typical project — 6 steps, difficulty rated medium, 3 of them with copy-paste commands.

Is moving from PlanetScale to Neon reversible?

No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your PlanetScale data before you start.

What does Neon cost compared to PlanetScale?

PlanetScale: freemium from $29/mo, free plan available. Neon: freemium from $19/mo, free plan available.