Answer the question
In order to leave comments, you need to log in
How does django "move" from SQLite to MySQL?
Now the project is in SQLite. Task: move to MySQL.
What I did:
1. Installed MySQL sudo apt-get isntall mysql-server
2. Dumped info
python manage.py dumpdata --natural > datadump.json
(without --natural gavedjango.db.utils.IntegrityError: Problem installing fixture 'datadump.json': Could not load contenttypes.ContentType(pk=20): (1062, "Duplicate entry 'payments-invitebonus' for key 'django_content_type_app_label_45f3b1d93ec8c61c_uniq'")
) DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'ppdb',
'USER': 'dbu',
'PASSWORD': 'dbp',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
},
}
python manage.py loaddata datadump.json;
django.db.utils.ProgrammingError: Problem installing fixture 'datadump.json': Could not load auth.User(pk=1): (1146, "Table 'ppdb.auth_user_user_permissions' doesn't exist")
Answer the question
In order to leave comments, you need to log in
dumpdata only downloads data without structure.
run syncdb first
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question