Magnolia 6.1 reached extended end of life on June 2, 2020. Support for this branch is limited, see End-of-life policy.

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

If you have already started your Magnolia project on Community Edition then it's simple to upgrade that project to DX Core (aka Enterprise Edition). Doing so will require that you have a license available to run the all the modules you would like to install. Magnolia developer trial licenses can be requested here for a term of 30 days. 

No matter how your project is currently built or maintained this tutorial will try and consolidate all possible approaches into a single best practice approach. In some cases you might have to adjust these instructions to suit your needs or deployment scenario. Enterprise customers (or potential customers) can always seek help from our Support channel by requesting the credentials from Sales. If you are considering moving a Community project the best place to start is by contacting out sales team. 

Getting started

It really does not matter how you currently deploy Magnolia. All you really need is to have an understanding of what modules you currently have installed. Anything custom you have added will need some special considerations as you move your project. 

As an example, let's consider the scenario where I am currently running in production the travel website on Magnolia 5.6.8 CE. My target is to bring the project up to Magnolia 6.1.2 DX Core.

Versions prior to 5.6 should migrate to 5.6 first. 5.6 requires Vaadin 8 and log4j2 upgrades. See the Release notes.

Maven project

In some cases users of Magnolia have downloaded our pre-assembled Tomcat bundles and used those as the basis for deployment. Adding modules manually to the libs folder prior to deployment. If this is how you currently deploy Magnolia then take this opportunity to begin using Maven to manage your war files instead. 

I will start under the condition that I have downloaded a pre-assembled bundle and deployed my travel website. Since I was new to Magnolia I have also deployed under the default conditions of using H2 as my production database. Now would be a good time to change that so I am using something more appropriate like MySQL. 

This means I need to complete the following steps. 

  • Create a maven project for 5.6.8 CE
  • Transfer the data from my H2 database to the new MySQL database

Use the archetype

If you are not familiar with Maven then I would suggest you see Maven setup and/or How to use Magnolia Maven archetypes. You don't need to know a lot about Maven to be proficient. Just have it installed and configured so that you can use it at the command line to build the project. See Module Quickstart.

If you already have a maven project then you can skip this step. 

  1. From the command line.

    florida:Upgrade rgange$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/
    [INFO] Scanning for projects...
    ...
    ...
    ...
    [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
    Choose archetype:
    1: https://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-theme-archetype (An archetype to create STK Theme modules)
    2: https://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-project-archetype (An archetype to create a Magnolia project (a parent pom and a webapp))
    3: https://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-module-archetype (An archetype to create basic Magnolia modules)
    4: https://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-forge-module-archetype (An archetype to create a Magnolia module to be hosted on the Magnolia Forge)
    5: https://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-blossom-module-archetype (An archetype to create Magnolia modules using Blossom)
    Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 2
    Choose info.magnolia.maven.archetypes:magnolia-project-archetype version: 
    1: 1.1.0
    2: 1.2.0
    3: 1.2.1
    4: 1.2.2
    5: 1.2.3
    6: 1.2.4
    7: 1.2.5
    8: 1.2.6-SNAPSHOT
    Choose a number: 8: 6
    Define value for property 'groupId': : info.magnolia.webapps
    Define value for property 'artifactId': : magnolia-cms
    Define value for property 'version':  1.0-SNAPSHOT: : 5.6.8-SNAPSHOT
    Define value for property 'package':  info.magnolia.webapps: : 
    Define value for property 'magnolia-bundle-version': : 5.6.8
    Define value for property 'project-name':  magnolia-cms: : 
    Confirm properties configuration:
    groupId: info.magnolia.webapps
    artifactId: magnolia-cms
    version: 5.6.8-SNAPSHOT
    package: info.magnolia.webapps
    magnolia-bundle-version: 5.6.8
    project-name: magnolia-cms
     Y: : Y
    [INFO] ----------------------------------------------------------------------------
    [INFO] Using following parameters for creating project from Archetype: magnolia-project-archetype:1.2.4
    [INFO] ----------------------------------------------------------------------------
    [INFO] Parameter: groupId, Value: info.magnolia.webapps
    [INFO] Parameter: artifactId, Value: magnolia-cms
    [INFO] Parameter: version, Value: 5.6.8-SNAPSHOT
    [INFO] Parameter: package, Value: info.magnolia.webapps
    [INFO] Parameter: packageInPathFormat, Value: info/magnolia/webapps
    [INFO] Parameter: magnolia-bundle-version, Value: 5.6.8
    [INFO] Parameter: package, Value: info.magnolia.webapps
    [INFO] Parameter: version, Value: 5.6.8-SNAPSHOT
    [INFO] Parameter: groupId, Value: info.magnolia.webapps
    [INFO] Parameter: project-name, Value: magnolia-cms
    [INFO] Parameter: artifactId, Value: magnolia-cms
    [INFO] Parent element not overwritten in /Users/rgange/Upgrade/magnolia-cms/magnolia-cms-webapp/pom.xml
    [INFO] project created from Archetype in dir: /Users/rgange/Upgrade/magnolia-cms
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 52.829 s
    [INFO] Finished at: 2019-09-27T11:33:56+02:00
    [INFO] Final Memory: 14M/170M
    [INFO] ------------------------------------------------------------------------
    florida:Upgrade rgange$ 
  2. Update the webapp pom.

    <!-- option ii - magnolia-community-webapp -->
    <!-- Dependencies versions are already imported by parent pom. Requires "Option A" in the parent pom. -->
    <dependency>
      <groupId>info.magnolia.bundle</groupId>
      <artifactId>magnolia-community-webapp</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>info.magnolia.bundle</groupId>
      <artifactId>magnolia-community-webapp</artifactId>
      <type>pom</type>
    </dependency>
  3. Build the project.

    florida:magnolia-cms rgange$ mvn clean install

    Result:

  4. Check for differences in your libraries. 

    Print to a file the WEB-INF/lib folder of the bundle and compare that with a file from the Maven built project.

    florida:lib rgange$ diff libs-maven.txt libs-bundle.txt 
    180a181
    > magnolia-module-public-user-registration-2.7.jar
    198a200
    > magnolia-sample-app-5.6.7.jar
    207a210,211
    > magnolia-travel-demo-1.2.5.jar
    > magnolia-travel-tours-1.2.5.jar
    222a227
    > mail-1.4.5.jar
    253c258
    < libs-maven.txt
    ---
    > libs-bundle.txt

    The bundle contains a few modules that are not included in the Maven project. 

  5. Update the webapp pom to include any missing libraries.

        <dependency>
          <groupId>info.magnolia.bundle</groupId>
          <artifactId>magnolia-community-webapp</artifactId>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>info.magnolia.bundle</groupId>
          <artifactId>magnolia-community-webapp</artifactId>
          <type>pom</type>
        </dependency>
    
        <!-- Include the travel demo -->
        <!-- By including travel demo it brings in the PUR and mail modules -->
        <dependency>
          <groupId>info.magnolia.demo</groupId>
          <artifactId>magnolia-travel-demo</artifactId>
        </dependency>
        <dependency>
          <groupId>info.magnolia.demo</groupId>
          <artifactId>magnolia-travel-tours</artifactId>
        </dependency>
    
        <!-- Include the sample app -->
        <!-- This could also represent a custom module in your project -->
        <dependency>
          <groupId>info.magnolia.sample</groupId>
          <artifactId>magnolia-sample-app</artifactId>
        </dependency>

Upgrade to DX Core

In this scenario the original instance was using H2 embedded database. A simple copy of the repositories folder will be enough to move the data to the new Maven based setup. If you are using another database then make sure the correct repo-confg file is located under WEB-INF/config/repoconfg.

  1. (Optional) Copy the repositories folder from the bundle instance over to the location of the Maven instance. This optional step only applies to setups which use an embedded database like H2 or Derby.
  2. Make sure you have the appropriate repository config file in your project. Also be sure the magnolia.properties file is configured to use the that repo config file.  
  3. Update the parent pom to use 6.1.2

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>info.magnolia.webapps</groupId>
      <artifactId>magnolia-cms</artifactId>
      <name>magnolia-cms (parent pom)</name>
    
      <!-- Update here -->
      <version>6.1.2-SNAPSHOT</version>
      <!-- *********** -->
      <packaging>pom</packaging>
    
      <properties>
    
        <!-- Update here -->
        <magnoliaBundleVersion>6.1.2</magnoliaBundleVersion>
        <!-- *********** -->
        <javaVersion>1.8</javaVersion>
      </properties>
  4. Update the parent pom to use DX Core.

    <dependency>
      <groupId>info.magnolia.dx</groupId>
      <artifactId>magnolia-dx-core-parent</artifactId>
      <version>${magnoliaBundleVersion}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  5. Update the webapp pom to use DX Core.

        <dependency>
          <groupId>info.magnolia.dx</groupId>
          <artifactId>magnolia-dx-core-webapp</artifactId>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>info.magnolia.dx</groupId>
          <artifactId>magnolia-dx-core-webapp</artifactId>
          <type>pom</type>
        </dependency>
    
        <!-- Include the travel demo -->
        <!-- By including travel demo it brings in the PUR and mail modules -->
        <dependency>
          <groupId>info.magnolia.demo</groupId>
          <artifactId>magnolia-travel-demo</artifactId>
        </dependency>
        <dependency>
          <groupId>info.magnolia.demo</groupId>
          <artifactId>magnolia-travel-tours</artifactId>
        </dependency>
    
        <!-- Include the sample app -->
        <!-- This could also represent a custom module in your project -->
        <dependency>
          <groupId>info.magnolia.sample</groupId>
          <artifactId>magnolia-sample-app</artifactId>
        </dependency>
  6. (Optional) Upgrade to Tomcat 9.
  7. With the classpath updated for 6.1.2 DX Core and the repository copied over from the 5.6.8 CE start up the instance to trigger the upgrade.

    No matter which database you use its best to make a copy to test the upgrade with. If you are using an external DB, such as MySQL, you will need to copy all tables as well repository folder.

    Initializing Log4J
    2019-09-27 16:02:06,764 INFO  info.magnolia.init.MagnoliaServletContextListener : Property sources loaded: [DefaultMagnoliaConfigurationProperties with sources: [SystemPropertySource][ServletContextPropertySource from WEB-INF/config/default/magnolia.properties][ModulePropertiesSource from modules [core, dam, freemarker-support, lang-da, license, periscope-api, speech-recognizer, categorization-support, ce-product-descriptor, device-detection, imaging-support, publishing-core, resource-loader, rest-client, rest-integration, config, i18n, publishing-receiver, publishing-sender, publishing-transactional-core, rest-services, cache, content-types, publishing-transactional-receiver, publishing-transactional-sender, rendering, ui-framework-core, virtual-uri, dam-jcr, ehcache3, imaging, link-unfurl, resteasy-client, tasks-app, templating, ui-framework, block-templating, diff, resources, scheduler, ui-admincentral, ui-framework-jcr, ui-mediaeditor, backup, cache-app, definitions-app, groovy, log-tools, magnolia-resources-templating, magnolia-usage-metrics, messages-app, pages, password-manager, publishing-app, resources-app, sample-app, security-app, site, task-management, tools, ui-contentapp, about-app, cache-browser-app, content-importer, dam-app, dam-imaging, dam-templating, diff-pages-integration, jcr-browser-app, jcr-tools, lang-el, ldap, mail, mte-imaging, periscope-core, publishing-transactional-app, site-app, soft-locking, workflow, admincentral, dependencies, enterprise, form, mte, periscope-result-ranker, rest-content-delivery, workflow-jbpm, cookie-manager, ee-pro-product-descriptor, javascript-models, mtk, multisite, personalization-integration, public-user-registration, rssaggregator, translation, visitor-manager, advanced-cache, advanced-cache-personalization, campaign-publisher, categorization, content-editor, marketing-tags, personalization-components, personalization-preview-app, personalization-segmentation-app, privacy-ui, translation-pages-integration, advanced-cache-app, advanced-cache-dpc, content-tags-core, lang-ar, lang-cs, lang-de, lang-es, lang-fi, lang-fr, lang-he, lang-hr, lang-hu, lang-id, lang-it, lang-ja, lang-nl, lang-no, lang-pl, lang-pt, lang-pt_BR, lang-ru, lang-sk, lang-sq, lang-sv, lang-tr, lang-zh_CN, lang-zh_TW, personalization-personas-app, stories-app, travel-demo, content-tags-ui, personalization-traits, sitemesh, tours, lang-ko, webapp]][InitPathsPropertySource]]
    ---------------------------------------------
    MAGNOLIA LICENSE
    ---------------------------------------------
    Version number : 6.1.2
    Core version   : 6.1.2
    Build          : 30. August 2019 (rev. 45722c9027a1e08d6ed285409c2a7d38829d6348 of UNKNOWN)
    Edition        : Magnolia DX Core
    Provider       : Magnolia International Ltd. (info@magnolia-cms.com)
    2019-09-27 16:02:06,793 INFO  info.magnolia.cms.beans.config.ConfigLoader       : Initializing content repositories
    2019-09-27 16:02:06,793 INFO  info.magnolia.repository.DefaultRepositoryManager : Loading JCR
    2019-09-27 16:02:06,801 INFO  info.magnolia.repository.DefaultRepositoryManager : Loading JCR magnolia
    2019-09-27 16:02:06,904 INFO  info.magnolia.jackrabbit.ProviderImpl             : Loading repository at /Users/rgange/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp3/wtpwebapps/magnolia-cms-webapp/repositories/magnolia (config file: /Users/rgange/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp3/wtpwebapps/magnolia-cms-webapp/WEB-INF/config/repo-conf/jackrabbit-bundle-h2-search.xml) - cluster id: "<unset>"
    2019-09-27 16:02:10,295 INFO  info.magnolia.jackrabbit.ProviderImpl             : Registering prefix [mgnl] with URI http://www.magnolia.info/jcr/mgnl
    2019-09-27 16:02:11,436 INFO  info.magnolia.repository.DefaultRepositoryManager : Loading workspace mgnlVersion (logical name magnolia-mgnlVersion).
    2019-09-27 16:02:11,440 INFO  info.magnolia.repository.DefaultRepositoryManager : Loading workspace default (logical name default).
    2019-09-27 16:02:11,444 INFO  info.magnolia.repository.DefaultRepositoryManager : Loading workspace mgnlSystem (logical name magnolia-mgnlSystem).
    2019-09-27 16:02:14,371 INFO  fo.magnolia.objectfactory.ObservedComponentFactory: /server does not exist, will return a new instance of class info.magnolia.cms.beans.config.ServerConfiguration.
    2019-09-27 16:02:14,386 INFO  info.magnolia.context.LifeTimeJCRSessionUtil      : Will handle lifetime sessions because the system context is of type interface info.magnolia.context.ThreadDependentSystemContext
    2019-09-27 16:02:20,921 INFO  fo.magnolia.objectfactory.ObservedComponentFactory: /server/rendering/freemarker does not exist, will return a new instance of class info.magnolia.freemarker.FreemarkerConfig.
    2019-09-27 16:02:21,108 INFO  fo.magnolia.objectfactory.ObservedComponentFactory: /server/auditLogging does not exist, will return a new instance of class info.magnolia.audit.AuditLoggingManager.
    2019-09-27 16:02:22,567 INFO  info.magnolia.module.webapp.WebappVersionHandler  : Content was not found in the repository, will bootstrap web-app.
    2019-09-27 16:02:22,583 INFO  info.magnolia.module.ui.ModuleManagerWebUI        : 
    *********************************************************************************************************
    *                                                                                                       *
    * Magnolia needs module updates or installs, point your browser to your Magnolia instance and confirm ! *
    *                                                                                                       *
    *********************************************************************************************************
  8. Trigger the update by going to http://localhost:8080/magnolia-cms-webapp
  9. Once the upgrade is completed apply the license via the registration form.

    If the installation encounters a problem open a support ticket and attach the entire log file from the upgrade.

Migrate the data

The original project was using H2 database. This is an embedded database and typically not ideal in a production environment. Mostly because the application would need to share memory with the database. Here we will migrate the data from H2 and move it to a MySQL instance.

If you do not need to Migrate to a different database then you can skip this step.

  1. Start the author instance using the database you wish to migrate data from. In this case its H2 database but it could be any database. The source database used does not matter.
  2. Using the Magnolia Backup module, take a manual backup of the current instance. 

    The Backup module is not part of community edition. Community edition users can make use of the migration groovy script.

  3. Restore the instance to the target MySQL database using the restore script provided by the Backup module. The instructions here.
  • No labels