1

I have a django project that I was initially running on pythonanywhere using a postgres database. However, pythonanywhere doesn't support ASGI, so I am migrating the project over to heroku. Since heroku either much prefers or mandates use of its own postgres functionality, I need to migrate the data from elephantsql. However, I'm really coming up short on how... I tried running pg_dumpall but it didn't seem to want to work and/or the file disappeared into the ether. I'm at a loss for how to make this migration... If anyone could help, I'd appreciate it so much. T-T

5
  • not an answer to your question, are you using any chat app in Django project ? if not why do you use ASGI ? Commented Jun 18, 2020 at 20:09
  • I am, yes. I'm using django channels. Commented Jun 18, 2020 at 20:19
  • try amazon ec2 postgresql, they have good customer support Commented Jun 18, 2020 at 20:27
  • You are migrating from PythonAnywhere --> Heroku, not sure how ElephantSQL got in the mix? Also what was the command you ran for pg_dumpall? Commented Jun 18, 2020 at 23:12
  • I migrated the code to heroku just fine, my problem is migrating the data from elephantsql to heroku Commented Jun 19, 2020 at 5:03

1 Answer 1

2

After hours of searching and doing what I can to scour heroku's listed info, I found it by running heroku pg:push --help.

For a locally running server, run
heroku pg:push '<db_name>' <heroku_db_name> --app <app_name>

For a hosted one, run
heroku pg:push <postgres_link> <heroku_db_name> --app <app_name>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.