Umair
Umair

Reputation: 1877

How can I import a local postgres file into my Heroku postgres database?

My django application is working perfectly fetching and inserting data into local postgres database. Now i have data in my local postgres database. When i deployed my app on heroku and run migrate command in heroku then it create the tables. But the tables are empty.

I just want to know that Did i have to insert all my data again in heroku postgres database or there is any way to migrate/export the local postgres database with data to heroku postgres database?

Upvotes: 0

Views: 692

Answers (1)

mahyar
mahyar

Reputation: 571

you can use django-admin dumpdata and django-admin loaddata commands run the first command in your local machine and upload the generated file to your server and run the loaddata command on your server to restore your data further reading example docs

Upvotes: 1

Related Questions