views:

315

answers:

4

I have an instance of Django-CMS already running in a production environment. I would like to dump all the data related to the CMS (PAGES and PLUGINS) so that I may load it back into my development environment.

When I do python manage.py dumpdata cms it dumps most of the data, but not all of it. None of the content for the plugins is dumped. When I look at the django-cms source, I see that the plugins are organized in a different folder than the rest of the models - I'm sure this has something to do with the behavior of dumpdata.

Does anyone know how they would achieve what I am trying to do?

Thanks for your help/answers!

+1  A: 

Your dumpdata command only dumps the data for the cms app, but each plugin (cms.plugins.text, cms.plugins.picture, etc.) is its own app, and so needs to be added to the command line.

Ignacio Vazquez-Abrams
`python manage.py dumpdata cms.plugins.text` generates the following result:`Error: Unknown application: cms.plugins.text`Even though I do have this listed as one of my installed applications in my main settings.py and the application is functioning correctly.
edub
Could you please show a working example of the dumpdata command that you use? (thanks)
edub
Have you been able to replicate this error?
edub
Err, no, but I don't use Django-CMS. You might want to try asking in `#django` on Freenode.
Ignacio Vazquez-Abrams
A: 

hi,

./manage.py dumpdata >fixtures/all.json

psql DBNAME

delete from auth_permission; delete from django_admin_log; delete from django_content_type;

./manage.py loaddata fixtures/all.json

works.

cheers,

philipp

Googol
+1  A: 

Here's an update to the procedure I use:

./manage.py dumpdata >fixtures/all.json

psql DROP DATABASE [DBNAME]; createdb -T template_postgis [DBNAME]

./manage.py syncdb

psyl [DBNAME]

delete from auth_group_permissions; delete from auth_permission; delete from django_admin_log; delete from django_content_type;

if you dont delete the tables above you'll get this error when loading the fixtures: IntegrityError: duplicate key value violates unique constraint "django_content_type_app_label_key"

./manage.py loaddata fixtures/all.json

Philipp

Googol
A: 

./manage.py dumpdata cms text

Amy Shelton