sulu

Is it possible to export and import content between installations?


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?


Solution

  • 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/)