Cannot import due to django_content error
loleg opened this issue · comments
Does this project support import into SQLite, or is it a problem with one of my app's modules? After following the instructions to the letter including the DB-prep step, running on a fresh deployment of Wagtail 2.12.6, Django 2.2.24, Python 3.9.6 this error is thrown:
IntegrityError at /admin/wagtail-transfer/import/
UNIQUE constraint failed: django_content_type.app_label, django_content_type.model
/home/oleg/.local/.../lib/python3.9/site-packages/django/db/backends/sqlite3/base.py in execute, line 383
If anyone could suggest a way to debug or get around this, the tip would be much appreciated.
Hi @loleg, sorry I missed this! Yes, this should be compatible with SQLite. Could you try adding:
WAGTAILTRANSFER_LOOKUP_FIELDS = {
'taggit.tag': ['slug'],
'wagtailcore.locale': ["language_code"],
'contenttypes.contenttype': ['app_label', 'model']
}
To your settings and seeing if this resolves things? Otherwise, could you let me know what you're trying to import and what its fields are?
Hi! I can confirm the same error. Setting those WAGTAILTRANSFER_LOOKUP_FIELDS
gives me another error:
IntegrityError at /admin/wagtail-transfer/import/
UNIQUE constraint failed: auth_permission.content_type_id, auth_permission.codename
The error is gone after changing to this:
WAGTAILTRANSFER_LOOKUP_FIELDS = {
'taggit.tag': ['slug'],
'wagtailcore.locale': ["language_code"],
'contenttypes.contenttype': ['app_label', 'model'],
'auth.permission': ['codename'],
}
But I'm not sure if that is right...
It imported an image, but not pages. =(
At some point, while trying to solve the error, I did a ./manage.py preseed_transfer_table auth wagtailcore wagtailimages.image wagtaildocs
at both sides, not sure if it's related.
I added a new page and tried to import it, got no error, but the page isn't imported.
@jacobtoppm sorry to have missed this question..a long while ago. Do you still need some input to close this?