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
-
not an answer to your question, are you using any chat app in Django project ? if not why do you use ASGI ?Anoop K George– Anoop K George2020-06-18 20:09:41 +00:00Commented Jun 18, 2020 at 20:09
-
I am, yes. I'm using django channels.MaxTheMooshroom– MaxTheMooshroom2020-06-18 20:19:25 +00:00Commented Jun 18, 2020 at 20:19
-
try amazon ec2 postgresql, they have good customer supportAnoop K George– Anoop K George2020-06-18 20:27:08 +00:00Commented 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?Adrian Klaver– Adrian Klaver2020-06-18 23:12:30 +00:00Commented Jun 18, 2020 at 23:12
-
I migrated the code to heroku just fine, my problem is migrating the data from elephantsql to herokuMaxTheMooshroom– MaxTheMooshroom2020-06-19 05:03:21 +00:00Commented Jun 19, 2020 at 5:03
Add a comment
|
1 Answer
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>