Migration of database

33 views
Skip to first unread message

Dhruvil Shah

unread,
Dec 15, 2020, 1:41:10 AM12/15/20
to django...@googlegroups.com
I have already made my project in Django and used built-in database Sqlite and now I want it in production on heroku so how can I switch all data from Sqlite database to Postgresql database? 

Omkar Parab

unread,
Dec 15, 2020, 1:46:29 AM12/15/20
to django...@googlegroups.com
Check out this video. 👇
https://youtu.be/6DI_7Zja8Zc

On Tue, Dec 15, 2020, 12:09 PM Dhruvil Shah <sdhru...@gmail.com> wrote:
I have already made my project in Django and used built-in database Sqlite and now I want it in production on heroku so how can I switch all data from Sqlite database to Postgresql database? 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADsP_iywX5jsBNRsoSgtPZtzgDD3befGdJgjWL-XgZi-feRdAA%40mail.gmail.com.

Alessandro Madruga Correia

unread,
Dec 15, 2020, 8:50:46 AM12/15/20
to django...@googlegroups.com



Em ter., 15 de dez. de 2020 às 03:40, Dhruvil Shah <sdhru...@gmail.com> escreveu:
I have already made my project in Django and used built-in database Sqlite and now I want it in production on heroku so how can I switch all data from Sqlite database to Postgresql database? 



In the source server

python manage.py dumpdata contenttypes --indent=2 --natural-foreign > contenttype.json

python manage.py dumpdata --indent=2 --natural-foreign --exclude contenttypes  > everything_else.json



In the destination server


python manage.py loaddata contenttype.json

python manage.py loaddata everything_else.json



--
  ,= ,-_-. =.   [<o>] Alessandro Madruga Correia
 ((_/)o o(\_))  [http://counter.li.org]       Debian User# 342751 
   `-'(. .)`-'    "O fanatismo é a única forma de força de vontade 
       \_/        acessível aos fracos." (Friedrich Nietzsche)

sakshi jain

unread,
Dec 15, 2020, 8:51:48 AM12/15/20
to django...@googlegroups.com

Kasper Laudrup

unread,
Dec 15, 2020, 11:48:42 AM12/15/20
to django...@googlegroups.com
On 15/12/2020 07.50, sakshi jain wrote:
> help me
>

Hopefully you can find the relevant contact information for your country
of origin here:

https://togetherweare-strong.tumblr.com/helpline

Best of luck with your issues, whatever they are.

Kind regards,

Kasper Laudrup
Reply all
Reply to author
Forward
0 new messages