Is there a way to export and import content from one sulu (1.6) installation to another? Let's say from a staging system to the production version?
2 Answers
Maybe the doctrine commands will help you.
!!! IMPORTANT !!! THIS IS A FULL COPY WHICH DELETES EXISTING DATA FROM TARGET INSTALLATION
Export from Staging:
bin/adminconsole doctrine:phpcr:workspace:export -p /cmf cmf.xml
bin/websiteconsole doctrine:phpcr:workspace:export -p /cmf cmf_live.xml
bin/adminconsole doctrine:phpcr:workspace:export -p /jcr:versions jcr.xml
Delete everything in the target installation (in your case production):
bin/adminconsole doctrine:phpcr:node:remove /cmf
bin/websiteconsole doctrine:phpcr:node:remove /cmf
bin/adminconsole doctrine:phpcr:node:remove /jcr:versions
Import into the target installation:
bin/adminconsole doctrine:phpcr:workspace:import -p / cmf.xml
bin/websiteconsole doctrine:phpcr:workspace:import -p / cmf_live.xml
bin/adminconsole doctrine:phpcr:workspace:import -p / jcr.xml
Also don't forget to copy the database and your uploads folder (var/uploads/)

- 46
- 3
-
1@Quehnie In the import you need use for cmf_live.xml also the websiteconsole can you change thix. – Alexander Schranz Sep 20 '19 at 13:53
-
ups yeah websiteconsole or --session=live – Quehnie Sep 20 '19 at 13:57
-
I know this is an old question, but I don't understand what does this export/import does exactly if you still need to import db and media? – Daniel G Sep 19 '22 at 18:45
Sorry but this question is too unspecific and not really sulu related. So the base answer is "yes".
sulu itself doesn't contain a service for this. This is mostly because your data can be very different and you can't really write something agnostic that fits any use case.
Still you are using symfony and the PHPCR. Of course you can export to basically format and import again. But how to do that has to be implemented on your site.

- 1
- 1