migrating to mysql in django
Question: I want to migrate from sqlite3 to mysql in django. I used this command:

    
    
    python manage.py dumpdata > datadump.json
    

after that I changed setting of my django server and configured it with my new
mysql database and then used following command:

    
    
    python manage.py loaddata datadump.json
    

but I got this error :

> integrityError: Problem installing fixtures: The row in table
> 'django_admin_log' with primary key '20' has an invalid foregin key:
> django_admin_log.user_id contains a value '19' that does not have a
> corresponding value in auth_user.id.


Answer: You have consistency error in your data, django_admin_log table refers to
auth_user which does not exist. sqlite does not enforce foreign key
constraints, but mysql does. You need to fix data and then you can import it
into mysql.

