Search code examples
djangodjango-filer

django filer dumpdata missing images


I'm having an issue trying to migrate content from my local development django cms with sqlite3 backend to AWS, with postgres. I'm using the following command to dump all the page data, titles, plugins and presumably, the filer images

manage.py dumpdata --indent=4 --natural-foreign --exclude cms.pageuser cms filer aldryn_bootstrap3 djangocms_column cmsplugin_filer_image cmsplugin_filer_file djangocms_googlemap djangocms_link djangocms_style djangocms_text_ckeditor > all_content.json

However, when i try to run loaddata in my staging environment, I get an foreignkey integrity error - specifically around the table filer_file. Looking at the table structure, for every image I have in filer_image, I should have a foreignkey reference in filer_file- which doesn't reflect what is in the JSON dumpfile.

Strangely, for documents(eg pdfs) the dumpdata command works fine, it is just related to images. Furthermore, if I manually generate the missing json data it works just fine.

Has anyone encountered this issue before? I've just upgraded to the following versions and still seeing the error.

aldryn-bootstrap3==1.0.10
cmsplugin-filer==1.1.2
colorama==0.3.3
dj-database-url==0.4.1
Django==1.9.7
django-appconf==1.0.2
django-bootstrap3==7.0.1
django-classy-tags==0.7.2
django-cms==3.3.0
django-debug-toolbar==1.4
django-durationfield==0.5.2
django-extensions==1.6.7
django-filer==1.2.4
django-fixture-magic==0.0.8
django-formtools==1.0
django-mail-templated==2.6.2
django-mptt==0.8.4
django-polymorphic==0.8.1
django-reversion==1.10.0
django-sekizai==0.9.0
Django-Select2==4.3.2
django-storages==1.4.1
django-treebeard==4.0.1
django-widget-tweaks==1.4.1
djangocms-admin-style==1.2.3
djangocms-attributes-field==0.1.0
djangocms-column==1.6.0
djangocms-googlemap==0.4.0
djangocms-inherit==0.2.1
djangocms-installer==0.8.8
djangocms-link==1.7.2
djangocms-style==1.7.0
djangocms-text-ckeditor==2.9.3
docutils==0.12
easy-thumbnails==2.3
html5lib==0.9999999
jmespath==0.9.0
Pillow==3.3.0
psycopg2==2.6.1
pyasn1==0.1.9
python-dateutil==2.5.3
pytz==2016.4
rsa==3.4.2
s3transfer==0.0.1
six==1.10.0
sqlparse==0.1.19
tzlocal==1.2.2
Unidecode==0.4.19

Solution

  • This is a workaround, not quite the answer. I believe the issue lies somewhere in the polymorphic/filer grey area. Writing your own serializer to mimic what dumpdata does, solved my issue.

    Logged a bug request regardless.

    https://github.com/divio/django-filer/issues/887