Home > Back-end >  how to copy my my production app data into my local host app
how to copy my my production app data into my local host app

Time:09-24

I deployed an app on Heroku and I have same app in my local machine now i want to copy all my deployed app data on my local app to so is there any way to do it anyway that will be very helpful because I don't know how to copy all my production data and paste it into my local machine I am using default sqlite3 Django default database

CodePudding user response:

Hope you are using heroku-cli otherwise install it on your local machine.
then run heroku run bash in the heroku-cli
now you can run django-admin dumpdata and copy the data dump, then save it in a local JSON file and import it to your local python app with loaddata

You can run bash from the Heroku dashboard (not cli) but it is not possible to copy data from there, another workaround is to upload db.sqlite to dropbox or to some other convenient cloud storage from the Heroku dashboard with the run bash method.

  • Related