DevOps

From Supabase to Neon: A Migration Guide

Step-by-step instructions for migrating your database from Supabase to Neon PostgreSQL.

AS

Andre Sarr

December 10, 202410 min read
Share

From Supabase to Neon: A Migration Guide


Migrating databases can be daunting, but with the right approach, it's straightforward.

Why Neon?


  • Serverless scaling: Pay for what you use
  • Branching: Database branches for development
  • Modern architecture: Built for the cloud-native era

  • Step 1: Export from Supabase


    ``bash
    pg_dump -h db.supabase.co -U postgres -d postgres > backup.sql
    `

    Step 2: Create Neon Database


    1. Sign up at neon.tech
    2. Create a new project
    3. Get your connection string

    Step 3: Import to Neon


    `bash
    psql "your-neon-connection-string" < backup.sql
    `

    Step 4: Update Application


    `typescript
    import { neon } from "@neondatabase/serverless"

    const sql = neon(process.env.DATABASE_URL!)
    ``

    Conclusion


    Migration to Neon is straightforward and the serverless benefits are worth it!
    PostgreSQLNeonDatabase
    AS

    Written by

    Andre Sarr

    Full-Stack Developer & Cybersecurity Enthusiast based in Dakar, Senegal.

    Get in touch
    1