Page tree
Skip to end of metadata
Go to start of metadata
Your Rating: Results: 1 Star2 Star3 Star4 Star5 Star 126 rates

How to create a copy of your Magnolia public instance

Imagine you have one author and three public instances running and one of your public instances is broken. Depending on the amount of content and the state of your instances you have a various options to repair the broken public instance:

  1. create a new, empty public instance and activate all content to it
    1. if you have at least one public instance working, you can activate all content from the working public instance into the new one to ensure they are in sync
    2. if all your public instances are corrupted you have to activate from the author to new public instance
  2. export all content, create new public instance and bootstrap all the exported content into it
    1. if you have at least one public instance working, you can export content from there
    2. if all your public instances are corrupted you have to export from author
  3. simply copy the database and the webapp folder, then edit the database connection information,
    1. you need at least one working public instance
    2. the connection information is located in the jackrabbit configuration file located at /webapps/magnoliaPublic/WEB-INF/config/repo-conf and in all the workspace.xml files in the /webapps/magnoliaPublic/repositories/magnolia/workspaces/* directories. Please note that connection info is added twice for each file!

Each mentioned approach has some advantages and disadvantages:

ad 1. This is probably the slowest approach, but gives you most control over the transfer of content from one instance to another.

ad 2. If you have a lot of content and many big files on your instance, you might choose this approach as it will be faster and you don't have to send all the content over http.

ad 3. This approach is perhaps the fastest one, but you need to have at least one working public instance to be able to use it. It also carries a risk of corrupting your surviving public instance should you forget to update the connection information in one of the configuration files of the copied web-app. For this reason, make sure that you have a backup of the database as well as backup of the web-app before replicating your public instance in this way.

There is a way how to export only f.e. activated content from author instance. You can:

A) parse exported xml and remove all nodes that do not have a subnode MetaData with mgnl:activated == true

B) modify the SAXFilter used for export to the content. It requires to write in Java your own export command similar to one provided by Magnolia and can introduce the filter that will exclude all non activated content. Have a look at info.magnolia.importexport.DataTransporter.executeExport() for example. You would have to extend VersionFilter used there to exclude also non activated content.

Related documentation

Backup and restore

Repository backup and restore

Backup and restore JSP scripts

Backup concept

Backup GUI 

JR backup tool

Persistence manager based backup