How to completely dump the data for Django-CMS

edub picture edub · Feb 24, 2010 · Viewed 11.4k times · Source

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!

Answer

Michael C. O'Connor picture Michael C. O'Connor · Feb 9, 2011

Django's built in dump and restore commands work well for migrating the contents of the CMS.

To dump the contents of the CMS, you need to include both the cms app as well as each of the plugin types you are using in the dumpdata command, so something like:

manage.py dumpdata cms text picture link file [other plugin types] > cms_export.json

to dump your content (you just need the app name, not the full path, like cms.plugins.text).