This topic present best practices for managing content and configurations across multiple environments (development, integration, pre-production, production).
Jahia, in the course of content creation and editing, guarantees the integrity of editorial content (staging, default workspace) and the isolation of published content (live workspace). This is accomplished in the same environment thanks to strictly compartmentalized system of two workspaces. This architecture makes it possible to create and edit content directly on the production environment without the risk of making non-finalized content available on the live site.
Content is created and edited directly on the production environment then made available on other environments on an as needed basis. The process to propagate content between environments is described later in this topic.
Content of a site can be exported or imported through different ways. Every method offers advantages and drawbacks answering to different needs, especially in terms of automating, performances and granularity.
An export at the system level can be carried out using the following steps:
The order of these steps is important to guarantee data integrity.
The following shows the procedure to restore from backup:
In clustered instance the following values may need to be modified in /digital-factory-config/jahia/jahia.node.properties file:
Jahia provides the possibility of exporting an entire site or a specific arborescence. This export can be done in one of two ways:
There are two ways to import a site zip file:
jahia.site.import.scanner.interval
property in the jahia.properties file. The default value is 30000ms.Jahia allows an export or import based on the subtree of a content node as well as a single node of the tree. This is a manual action that is started from, the Editor Mode or from one of the Manager UI (Content Manager, File Manager, etc).
To export a node and its subnodes; right click on the node in the Editor Mode and select “Export” from the menu.
The environment for content contribution should always be the production environment:
This content can then be broadcast over different environments using methods described in this documentation.
An exported content item will be compatible with an environment if:
or
Initial creation of content can be done in two different ways:
Regardless of the method used, it is recommended to consistently keep content contribution in a single environment.
Several methods of export and import can be automated to allow sync of content from one environment to another.
The automation of content replication is trivial and can use the same mechanisms that are outlined in the production server backup procedure
The automation of the replication procedure can be done as follows:
Command wget
http://<Serverip>:<port>/cms/export/default/{siteKey}.zip?exportformat=site&live=true&sitebox={siteKey} --http- user=root --http-password={ROOT_PASSWORD} --auth-no-challenge
Copy the exported file to the digital-factory-data/imports folder on the destination platform.
The automated import of a site does not overwrite the previous version of the site if it still exists on this platform. It is necessary to remove the previous version first. This action can be automated using a groovy script.
How often to replicate content depends on the needs of the particular organization. The following list shows common restrictions and constraints when choosing a replication schedule:
A compromise must be found between these different restrictions and risks.
The import of technical content via a module is made thanks to the src/main/import/repository.xml file in the module. The repository.xml file, containing the standard JCR data tree, can be automatically generated using a partial export of the content. (See the section on import methodology).