How to dump django-cms related content to migrate with running instance?

I have a similar problem. My database often changes in a production environment, so I want to prepare the local cms content and migrate it with the production database. How can i do this?

In django-cms there should be a convenient way for such tasks.

+4
source share
1 answer

It's pretty easy to dump and restore CMS content using the Django created in manage.py commands, so I think that you could achieve a long way to your goal with just that.

To dump the contents of the CMS, you need to enable both the cms application and each of the types of plugins that you use in the dumpdata command, so:

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

to upload your content and

 manage.py loaddata cms_export 

to restore it. Of course, you will also have to loop and move any media files that you have downloaded.

If this repeats, you may want to look into the fabric - this will allow you to automate the transfer of content through the ssh channel.

+6
source

Source: https://habr.com/ru/post/1337144/


All Articles