Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from heroku and Heroku-Postgres to Supabase #60

Open
TheOriginalSoni opened this issue Jul 31, 2024 · 1 comment
Open

Convert from heroku and Heroku-Postgres to Supabase #60

TheOriginalSoni opened this issue Jul 31, 2024 · 1 comment

Comments

@TheOriginalSoni
Copy link
Collaborator

TheOriginalSoni commented Jul 31, 2024

Update with new DB

@TheOriginalSoni
Copy link
Collaborator Author

Steps to convert from Heroku Postgres to Supabase

#Download local backup of Heroku DB
heroku pg:backups:capture -a my-heroku-app
heroku pg:backups:download -a my-heroku-app

#Make DB locally on Postgres
sudo -u postgres psql
create database new_db_name;

#Convert local backup into local postgres DB
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d new_db_name -U postgres latest.dump

#Convert local DB to sql file dump
pg_dump -U <local-db-username> -h localhost -d my-local-db > localdb.sql

#Then make a new project on Supabase
#Follow usual steps for it, wait for Database to be made. Once completed, go to Connect - PSQL and copy the string

#Upload local sql file dump to Supabase
#Edit the PSQL code from above to add the relevant additional parameters
psql -h <supabase-db-host>.supabase.com -p <supabase-db-port> -U postgres.<supabase-db-username> -d <supabase-db-name> -f localdb.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant