apps/docs/content/guides/platform/migrating-to-supabase/heroku.mdx
Supabase is one of the best free alternatives to Heroku Postgres. This guide shows how to migrate your Heroku Postgres database to Supabase. This migration requires the pg_dump and psql CLI tools, which are installed automatically as part of the complete Postgres installation package.
Alternatively, use the Heroku to Supabase migration tool to migrate in just a few clicks.
$HEROKU_HOST)$HEROKU_DATABASE)$HEROKU_USER)$HEROKU_PASSWORD)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 \
-h $HEROKU_HOST -U $HEROKU_USER -d $HEROKU_DATABASE \
--no-owner --no-privileges > heroku_dump.sql
Use psql to import the Heroku database file to your Supabase project.
psql -d "$YOUR_CONNECTION_STRING" -f heroku_dump.sql
--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.