How to dump django-cms related contents in order to migrate with running instance?
I have a similar problem to solve. My database changes frequently on produ开发者_JAVA百科ction environment, so I want to prepare my cms contents locally and migrate it with the production database. How can I do that?
There should be a handy way for tasks like this in django-cms.
It's pretty straightforward to dump and restore the contents of the CMS using Django's built in manage.py commands, so I think you could get a long way towards your goal with just that.
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 and
manage.py loaddata cms_export
to restore it. You'll also have to zip up and move any media files you've uploaded as well, of course.
If this is going to be something that you do repeatedly, you might want to look into fabric -- that'll let you automate the content migration across an ssh channel.
精彩评论