Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

added vercel-postgres migration guide 'Migrate from Vercel Postgres t… (#29983)

Mark Burggrafe3e6f7dcf75f
diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx
index ad7a21f787b..b01885c6b6d 100644
--- a/apps/docs/app/page.tsx
+++ b/apps/docs/app/page.tsx
@@ -4,6 +4,7 @@ import { IconBackground, TextLink } from 'ui'
import { IconPanel } from 'ui-patterns/IconPanel'
import MenuIconPicker from '~/components/Navigation/NavigationMenu/MenuIconPicker'
+import { MIGRATION_PAGES } from '~/components/Navigation/NavigationMenu/NavigationMenu.constants'
import { GlassPanelWithIconPicker } from '~/features/ui/GlassPanelWithIconPicker'
import { IconPanelWithIconPicker } from '~/features/ui/IconPanelWithIconPicker'
import HomeLayout from '~/layouts/HomeLayout'
@@ -70,60 +71,6 @@ const products = [
},
]
-const migrationGuides = [
- {
- title: 'Auth0',
- icon: '/docs/img/icons/auth0-icon',
- href: '/guides/resources/migrating-to-supabase/auth0',
- hasLightIcon: true,
- },
- {
- title: 'Firebase Auth',
- icon: '/docs/img/icons/firebase-icon',
- href: '/guides/resources/migrating-to-supabase/firebase-auth',
- },
- {
- title: 'Firestore Data',
- icon: '/docs/img/icons/firebase-icon',
- href: '/guides/resources/migrating-to-supabase/firestore-data',
- },
- {
- title: 'Firebase Storage',
- icon: '/docs/img/icons/firebase-icon',
- href: '/guides/resources/migrating-to-supabase/firebase-storage',
- },
- {
- title: 'Heroku',
- icon: '/docs/img/icons/heroku-icon',
- href: '/guides/resources/migrating-to-supabase/heroku',
- },
- {
- title: 'Render',
- icon: '/docs/img/icons/render-icon',
- href: '/guides/resources/migrating-to-supabase/render',
- },
- {
- title: 'Amazon RDS',
- icon: '/docs/img/icons/aws-rds-icon',
- href: '/guides/resources/migrating-to-supabase/amazon-rds',
- },
- {
- title: 'Postgres',
- icon: '/docs/img/icons/postgres-icon',
- href: '/guides/resources/migrating-to-supabase/postgres',
- },
- {
- title: 'MySQL',
- icon: '/docs/img/icons/mysql-icon',
- href: '/guides/resources/migrating-to-supabase/mysql',
- },
- {
- title: 'MSSQL',
- icon: '/docs/img/icons/mssql-icon',
- href: '/guides/resources/migrating-to-supabase/mssql',
- },
-]
-
const selfHostingOptions = [
{
title: 'Auth',
@@ -268,11 +215,11 @@ const HomePage = () => (
</div>
<ul className="grid col-span-8 grid-cols-12 gap-6 not-prose">
- {migrationGuides.map((guide) => {
+ {MIGRATION_PAGES.map((guide) => {
return (
- <li key={guide.title} className="col-span-6 md:col-span-4">
- <Link href={guide.href} passHref>
- <IconPanel {...guide} background={true} showLink={false} />
+ <li key={guide.name} className="col-span-6 md:col-span-4">
+ <Link href={guide.url} passHref>
+ <IconPanel {...guide} title={guide.name} background={true} showLink={false} />
</Link>
</li>
)
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index ac355889d2d..6aa8637e1ff 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -1,3 +1,7 @@
+import type { ComponentProps } from 'react'
+
+import type { IconPanel } from 'ui-patterns/IconPanel'
+
import type { GlobalMenuItems, NavMenuConstant, NavMenuSection } from '../Navigation.types'
export const GLOBAL_MENU_ITEMS: GlobalMenuItems = [
@@ -1809,23 +1813,64 @@ export const local_development: NavMenuConstant = {
],
}
-export const MIGRATION_PAGES: Partial<NavMenuSection>[] = [
- { name: 'Amazon RDS', url: '/guides/platform/migrating-to-supabase/amazon-rds' },
- { name: 'Auth0', url: '/guides/platform/migrating-to-supabase/auth0' },
- { name: 'Firebase Auth', url: '/guides/platform/migrating-to-supabase/firebase-auth' },
+export const MIGRATION_PAGES: Partial<NavMenuSection & ComponentProps<typeof IconPanel>>[] = [
+ {
+ name: 'Auth0',
+ icon: '/docs/img/icons/auth0-icon',
+ url: '/guides/platform/migrating-to-supabase/auth0',
+ hasLightIcon: true,
+ },
{
- name: 'Firebase Firestore',
+ name: 'Firebase Auth',
+ icon: '/docs/img/icons/firebase-icon',
+ url: '/guides/platform/migrating-to-supabase/firebase-auth',
+ },
+ {
+ name: 'Firestore Data',
+ icon: '/docs/img/icons/firebase-icon',
url: '/guides/platform/migrating-to-supabase/firestore-data',
},
{
name: 'Firebase Storage',
+ icon: '/docs/img/icons/firebase-icon',
url: '/guides/platform/migrating-to-supabase/firebase-storage',
},
- { name: 'Heroku Postgres', url: '/guides/platform/migrating-to-supabase/heroku' },
- { name: 'MySQL', url: '/guides/platform/migrating-to-supabase/mysql' },
- { name: 'MSSQL', url: '/guides/platform/migrating-to-supabase/mssql' },
- { name: 'Postgres', url: '/guides/platform/migrating-to-supabase/postgres' },
- { name: 'Render', url: '/guides/platform/migrating-to-supabase/render' },
+ {
+ name: 'Heroku',
+ icon: '/docs/img/icons/heroku-icon',
+ url: '/guides/platform/migrating-to-supabase/heroku',
+ },
+ {
+ name: 'Render',
+ icon: '/docs/img/icons/render-icon',
+ url: '/guides/platform/migrating-to-supabase/render',
+ },
+ {
+ name: 'Amazon RDS',
+ icon: '/docs/img/icons/aws-rds-icon',
+ url: '/guides/platform/migrating-to-supabase/amazon-rds',
+ },
+ {
+ name: 'Postgres',
+ icon: '/docs/img/icons/postgres-icon',
+ url: '/guides/platform/migrating-to-supabase/postgres',
+ },
+ {
+ name: 'Vercel Postgres',
+ icon: '/docs/img/icons/vercel-icon',
+ url: '/guides/platform/migrating-to-supabase/vercel-postgres',
+ hasLightIcon: true,
+ },
+ {
+ name: 'MySQL',
+ icon: '/docs/img/icons/mysql-icon',
+ url: '/guides/platform/migrating-to-supabase/mysql',
+ },
+ {
+ name: 'MSSQL',
+ icon: '/docs/img/icons/mssql-icon',
+ url: '/guides/platform/migrating-to-supabase/mssql',
+ },
]
export const platform: NavMenuConstant = {
diff --git a/apps/docs/content/guides/platform/migrating-to-supabase.mdx b/apps/docs/content/guides/platform/migrating-to-supabase.mdx
index 494520af8af..f4715f672cf 100644
--- a/apps/docs/content/guides/platform/migrating-to-supabase.mdx
+++ b/apps/docs/content/guides/platform/migrating-to-supabase.mdx
@@ -11,7 +11,13 @@ Learn how to migrate to Supabase from another database service.
<div className="grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-6 mb-6 not-prose">
{migrationPages.map((page) => (
<Link href={`${page.url}`} key={page.url} passHref>
- <GlassPanel title={page.name} background={false} className="[&>div]:p-4" />
+ <GlassPanel
+ icon={page.icon}
+ title={page.name}
+ hasLightIcon={page.hasLightIcon}
+ background={false}
+ className="[&>div]:p-4"
+ />
</Link>
))}
</div>
diff --git a/apps/docs/content/guides/platform/migrating-to-supabase/vercel-postgres.mdx b/apps/docs/content/guides/platform/migrating-to-supabase/vercel-postgres.mdx
new file mode 100644
index 00000000000..a94bfaf697f
--- /dev/null
+++ b/apps/docs/content/guides/platform/migrating-to-supabase/vercel-postgres.mdx
@@ -0,0 +1,97 @@
+---
+title: 'Migrate from Vercel Postgres to Supabase'
+description: 'Migrate your existing Vercel Postgres database to Supabase.'
+subtitle: 'Migrate your existing Vercel Postgres database to Supabase.'
+---
+
+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.
+
+## Retrieve your Vercel Postgres database credentials [#retrieve-credentials]
+
+1. Log in to your Vercel Dashboard [https://vercel.com/login](https://vercel.com/login).
+1. Click on the **Storage** tab.
+1. Click on your Postgres Database.
+1. Under the **Quickstart** section, select **psql** then click **Show Secret** to reveal your database password.
+1. Copy the string after `psql ` to the clipboard.
+
+Example:
+
+```bash
+psql "postgres://default:[email protected]:5432/verceldb?sslmode=require"
+```
+
+Copy this part to your clipboard:
+
+```bash
+"postgres://default:[email protected]:5432/verceldb?sslmode=require"
+```
+
+## Set your OLD_DB_URL environment variable
+
+Set the **OLD_DB_URL** environment variable at the command line using your Vercel Postgres Database credentials.
+
+Example:
+
+```bash
+export OLD_DB_URL="postgres://default:[email protected]:5432/verceldb?sslmode=require"
+```
+
+## Retrieve your Supabase connection string [#retrieve-supabase-connection-string]
+
+1. If you're new to Supabase, [create a project](https://supabase.com/dashboard).
+ Make a note of your password, you will need this later. If you forget it, you can [reset it here](https://supabase.com/dashboard/project/_/settings/database).
+
+1. Go to the [Database settings](https://supabase.com/dashboard/project/_/settings/database) for your project in the Supabase Dashboard.
+1. Under **Connection string**, select **URI**, make sure **Display connection pooler** is checked, and **Mode: Session** is set.
+1. Click the **Copy** button to the right of your connection string to copy it to the clipboard.
+
+## Set your NEW_DB_URL environment variable
+
+Set 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:
+
+```bash
+export NEW_DB_URL="postgresql://postgres.xxxxxxxxxxxxxxxxxxxx:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:5432/postgres"
+```
+
+## Migrate the database
+
+You will need the [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) and [psql](https://www.postgresql.org/docs/current/app-psql.html) command line tools, which are included in a full [PostgreSQL installation](https://www.postgresql.org/download).
+
+1. 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`).
+
+```bash
+pg_dump "$OLD_DB_URL" \
+ --clean \
+ --if-exists \
+ --quote-all-identifiers \
+ --no-owner \
+ --no-privileges \
+ > dump.sql
+```
+
+2. Import the database to your Supabase project
+
+ Use `psql` to import the Postgres database file to your Supabase project.
+
+ ```bash
+ psql -d "$NEW_DB_URL" -f dump.sql
+ ```
+
+Additional options
+
+- To only migrate a single database schema, add the `--schema=PATTERN` parameter to your `pg_dump` command.
+- To exclude a schema: `--exclude-schema=PATTERN`.
+- To only migrate a single table: `--table=PATTERN`.
+- To exclude a table: `--exclude-table=PATTERN`.
+
+Run `pg_dump --help` for a full list of options.
+
+<MigrationWarnings />
+
+## Enterprise
+
+[Contact us](https://forms.supabase.com/enterprise) if you need more help migrating your project.
diff --git a/apps/docs/public/img/icons/vercel-icon-light.svg b/apps/docs/public/img/icons/vercel-icon-light.svg
new file mode 100644
index 00000000000..72948d01a7d
--- /dev/null
+++ b/apps/docs/public/img/icons/vercel-icon-light.svg
@@ -0,0 +1,3 @@
+<svg width="1155" height="1000" viewBox="0 0 1155 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M577.344 0L1154.69 1000H0L577.344 0Z" fill="black"/>
+</svg>
diff --git a/apps/docs/public/img/icons/vercel-icon.svg b/apps/docs/public/img/icons/vercel-icon.svg
new file mode 100644
index 00000000000..4e3b0e93358
--- /dev/null
+++ b/apps/docs/public/img/icons/vercel-icon.svg
@@ -0,0 +1,3 @@
+<svg width="1155" height="1000" viewBox="0 0 1155 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M577.344 0L1154.69 1000H0L577.344 0Z" fill="white"/>
+</svg>