This page explains the concept of bootstrapping and bootstrap files in general.
- 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).
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>.xmlformat. For example
website.travel.about.xmlis the filename for the XML export of the
travel/aboutpage in the
- The filename determines where the content will be applied when bootstrapped into the JCR. For example
config.modules.pages.xmlis applied in the
configworkspace in the
- 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:
- JCR Browser app
- Export tool in the JCR Tools app
- Many, but not all content apps, for instance Assets app, Pages app and Configuration app, provide dedicated export actions.
To create a bootstrap file:
- In any app which can export JCR data, select a content node and click Export.
- Save the file. Do not change the autogenerated file name.
- 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.)