Skip to content

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

Update Heroku migration guide

dannykngba2667fc85fd
diff --git a/apps/reference/docs/guides/migrations/heroku.mdx b/apps/reference/docs/guides/migrations/heroku.mdx
index d10d99dce9e..0b67ae64734 100644
--- a/apps/reference/docs/guides/migrations/heroku.mdx
+++ b/apps/reference/docs/guides/migrations/heroku.mdx
@@ -5,35 +5,28 @@ description: 'Migrate your Heroku Postgres database to Supabase.'
sidebar_label: Heroku
---
-## Prerequisites
+Learn how to migrate your Heroku Postgres database to Supabase. This migration requires the [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) and [psql](https://www.postgresql.org/docs/current/app-psql.html) CLI tools.
-- A Heroku project with a Postgres database you want to migrate to Supabase
-- A Supabase project you want to migrate into
-- pg_dump command-line tool installed
-- psql command-line tool installed
+## Retrieve your Heroku database credentials {#retrieve-heroku-credentials}
-## Get your Heroku database credentials
+1. Log in to your [Heroku account](https://heroku.com) and select the project you want to migrate.
+1. Click **Resources** in the menu and select your **Heroku Postgres** database.
+1. Click **Settings** in the menu.
+1. Click **View Credentials** and save the following information:
+ - Host (`$HEROKU_HOST`)
+ - Database (`$HEROKU_DATABASE`)
+ - User (`$HEROKU_USER`)
+ - Password (`$HEROKU_PASSWORD`)
-- Log into Heroku (https://heroku.com)
-- Select your project
-- Click `Resources` in the menu
-- Select your `Heroku Postgres` database
-- Click `Settings` in the menu
-- Click `View Credentials`
-- Save your credentials:
- - Host (`$HEROKU_HOST`)
- - Database (`$HEROKU_DATABASE`)
- - User (`$HEROKU_USER`)
- - Password (`$HEROKU_PASSWORD`)
+## Retrieve your Supabase Host {#retrieve-supabase-host}
-## Get your Supabase Host
+1. If you're new to Supabase, [create a project](https://app.supabase.com).
+1. Go to the [Database settings](https://app.supabase.com/project/_/settings/database) for your project in the Supabase Dashboard.
+1. Under **Connection Info**, note your Host (`$SUPABASE_HOST`).
-- Log into the Supabase Dashboard (https://supabase.com)
-- Select your project
-- Select Settings / Database
-- Under Connection Info / Host, note your Host (`$SUPABASE_HOST`)
+## Export your Heroku database to a file {#export-heroku-database}
-## Dump your Heroku Database to a file
+Use `pg_dump` with your Heroku credentials to export your Heroku database to a file (e.g., `heroku_dump.sql`).
```
pg_dump --clean --if-exists --quote-all-identifiers \
@@ -41,15 +34,17 @@ pg_dump --clean --if-exists --quote-all-identifiers \
--no-owner --no-privileges > heroku_dump.sql
```
-## Import the data to your Supabase project
+## Import the database to your Supabase project {#import-database-to-supabase}
+
+Use `psql` to import the Heroku database file to your Supabase project.
```
psql -h $SUPABASE_HOST -U postgres -f heroku_dump.sql
```
-## (Optional) Post processing
+## (Optional) Post processing {#post-processing}
-If you're using graphql with your Supabase projects, you may need to issue the following SQL command in your Supabase Dashboard (Query Editor) to make sure the new tables show up:
+If you're using GraphQL with your Supabase project, you may need to run the following SQL command in the Supabase Dashboard (SQL Editor) to make sure the new tables show up:
```sql
select graphql.rebuild_schema();
@@ -60,6 +55,6 @@ select graphql.rebuild_schema();
- 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 tables: `--exclude-table=PATTERN`.
+- To exclude a table: `--exclude-table=PATTERN`.
Run `pg_dump --help` for a full list of options.