apps/docs/content/guides/platform/migrating-to-supabase/vercel-postgres.mdx
This guide demonstrates how to migrate your Vercel Postgres database to Supabase to get the most out of Postgres while gaining access to all the features you need to build a project.
psql to the clipboard.Example:
psql "postgres://default:[email protected]:5432/verceldb?sslmode=require"
Copy this part to your clipboard:
"postgres://default:[email protected]:5432/verceldb?sslmode=require"
OLD_DB_URL environment variableSet the OLD_DB_URL environment variable at the command line using your Vercel Postgres Database credentials.
Example:
export OLD_DB_URL="postgres://default:[email protected]:5432/verceldb?sslmode=require"
If you're new to Supabase, create a project. Make a note of your password, you will need this later. If you forget it, you can reset it here.
On your project dashboard, click Connect
Under the Session pooler, click the Copy button to the right of your connection string to copy it to the clipboard.
NEW_DB_URL environment variableSet the NEW_DB_URL environment variable at the command line using your Supabase connection string. You will need to replace [YOUR-PASSWORD] with your actual database password.
Example:
export NEW_DB_URL="postgresql://postgres.xxxxxxxxxxxxxxxxxxxx:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:5432/postgres"
You will need the pg_dump and psql command line tools, which are included in a full Postgres installation.
Export your database to a file in console
Use pg_dump with your Postgres credentials to export your database to a file (e.g., dump.sql).
pg_dump "$OLD_DB_URL" \
--clean \
--if-exists \
--quote-all-identifiers \
--no-owner \
--no-privileges \
> dump.sql
Import the database to your Supabase project
Use psql to import the Postgres database file to your Supabase project.
psql -d "$NEW_DB_URL" -f dump.sql
Additional options
--schema=PATTERN parameter to your pg_dump command.--exclude-schema=PATTERN.--table=PATTERN.--exclude-table=PATTERN.Run pg_dump --help for a full list of options.
<$Partial path="migration_warnings.mdx" />
Contact us if you need more help migrating your project.