I have developed a simple django application using sqlite3. At first, I wanted to keep it simple using sqlite3 but, things are beginning to scale up (Yes, I actually started using that application with sqlite3! Shame on me...) so I want to migrate all my data to postgresql database.
Does django or another third-party provide such feature, or should I suffer for my own stupidity...
First, execute
manage.py dumpdata > out.json
then change your DB config, migrate (or syncdb) and finally
echo "delete from auth_permission; delete from django_content_type;" | python manage.py dbshell
(If you have Django older than 1.11, you need to use
echo "delete from django_content_type;" | manage.py dbshell
)
Then load the JSON file:
manage.py loaddata out.json
(as of 2013 django_contenttype
is replaced with django_content_type
)