Page tree
Skip to end of metadata
Go to start of metadata

This page explains the concept of bootstrapping and bootstrap files in general.

Bootstrap files:

  • Allow you to load content into the JCR. 
  • Can be selectively shared across all Magnolia instances. 
  • Typically contain configuration necessary to run modules or content (such as pages, assets and others).

Bootstrap mechanism

The bootstrapping mechanism, directory location and management for Maven modules and light modules is different. See:

What is a bootstrap file?

A bootstrap file is an XML file representing JCR data created by an export action. 

Bootstrap files can contain any type of data which can be stored in JCR - including both text and binary data - used as content or for configuration.

Bootstrap files are used to import the data into Magnolia. The import action adds the data from the bootstrap file to its corresponding JCR workspace.

Bootstrap file format

Exported bootstrap files are in XML format. 

  • The XML structure reflects the hierarchical data stored in JCR. 
  • The autogenerated name of the exported XML file reflects the path of the exported data in the <workspace>.<path to content>.xml format. For example website.travel.about.xml is the filename for the XML export of the travel/about page in the website workspace.
  • The filename determines where the content will be applied when bootstrapped into the JCR. For example config.modules.pages.xml is applied in the config workspace in the modules/pages folder.
  • Bootstrap files contain all JCR properties for every node (such as mgnl:created, mgnl:lastModified, mgnl:lastModifiedBy, jcr:createdBy, jcr:primaryType, etc.). This makes the XML files big and hard to read. It is not advisable to manually edit bootstrap files, unless you really know what you are doing.

Creating a bootstrap file

Every JCR node in AdminCentral can be exported as XML. The export of a node is always inclusive of its subnodes.

Magnolia provides various possibilities to export JCR data as bootstrap files:

To create a bootstrap file:

  1. In any app which can export JCR data, select a content node and click Export.
  2. Save the file. (warning) Do not change the autogenerated file name.
  3. Place the file in the bootstrap folder. (Maven modules | Light modules).  

It is good practice to split up bootstrap files into smaller portions. This helps to ease both updating bootstrap files and to ensure that multiple developers can work on the same module without creating conflicts. (Resolving conflicts of bootstrap files when using revision control systems such as CVS, subversion or GIT can be hard.)

  • No labels