mysqldjangodjango-modelsdjango-mysql

How to Load a .dump File Format Using manage.py loaddata in Django?


I have a data.dump file for mysql and am trying to use manage.py loaddatato fill my db with this data file, but getting this error:

CommandError: Problem installing fixture '˜/Downloads/data': dump is not a known serialization format.

Apparently this is not a known format for Django loaddata. The question is how I can convert a .dump to .json, so I can use it with loaddata command?


Solution

  • If you crated your data.dump via MySQL there is, AFAIK, no way to load it via manage.py loaddata.

    You can use this command to import so-called "fixtures" created with manage.py dumpdata

    You will have to import your MySQL data dump directly into your new MySQL database.