What's the best way to migrate a Django DB from SQLite to MySQL?

GJ. picture GJ. · Jun 14, 2010 · Viewed 34.6k times · Source

I need to migrate my db from sqlite to mysql, and the various tools/scripts out there are too many for me to easily spot the safest and most elegant solution.

This seemed to me nice http://djangosnippets.org/snippets/14/ but appears to be 3 years since getting an update which is worrying..

Can you recommend a solution that is known to be reliable with Django 1.1.1 ?

Answer

Martin Eve picture Martin Eve · Jun 14, 2010

Execute:

python manage.py dumpdata > datadump.json

Next, change your settings.py to the mysql database.

Finally:

python manage.py loaddata datadump.json