Published on April 12, 2017 by Guest blogger
The Tricode website has been running on Magnolia CMS for a couple of years - a great CMS that gives a lot of options to content managers and marketeers in the area of digital marketing. Magnolia keeps improving its CMS, so updates are sometimes required. In this blog, Martijn Kooijman from Tricode tells how he upgraded from Magnolia version 5.3 to 5.5.
As a Magnolia developer, I have become very enthusiastic about all the new features of Magnolia 5.5. To renew my Magnolia knowledge for this version, I took the opportunity to upgrade the Tricode website's old 5.3 Magnolia version to the latest 5.5 version. There are a number of important advantages to this version:
- Improved author environment
- Simplified actions
- Image previews
- Site definition
- Improved JCR viewer: better insight in repository contents
- Light development (YAML configuration for components, which replaces complex XML structures)
- Java 8
There are two ways to perform the Magnolia 5.5 upgrade. I will summarize both:
1. Simply update the Magnolia version in the pom.xml
This looks simple enough, but has disadvantages too: you are going to run into dependency issues. This makes the upgrade not always seamless: a number of components have been changed/upgraded; some have even been replaced by new ones. If you have developed your own modules (like we have done at Tricode), then you will have to upgrade them to the latest Magnolia version first, or the upgrade of the site will not work.
Finally, you will have to upgrade all (Java) code to Java 8 and then check the entire codebase for the use of deprecated methods and classes.
2. Start over from scratch and add components and templates step-by-step
This is much more work, but when upgrading to Magnolia 5.5, it is the safest option. Above all, it guarantees that you're using the latest Magnolia components in the correct way.
I compared both solutions and chose a hybrid model:
1. I first started upgrading our external modules.
2. Then I upgraded the Magnolia version in the old website project, along with the latest versions of the now-upgraded external modules, after which I started the server locally.
After some code adjustments, I managed to boot the server successfully and this way I could access the Magnolia Configuration App in order to do a number of JCR configuration exports. I exported all our website components and dialogs (of course in the new YAML format!) plus all website data (contacts, blogs, events, images, etc).
3. With all these exports, I started a completely new project, thereby following the structure as given at the Magnolia Developer training.
4. The next step was to copy all Freemarker templates from the old project to the new one (and at the same time make a number of improvements: especially in the area of null-checking, there was room for improvement - a hint that a Magnolia trainer gave me about an area forgotten by many developers).
5. The final step was to recreate all pages in the site. In theory, this step was not needed and we coud have exported/imported all pages from the old site, but I had done some improvements to page and component templates, which unfortunately prevented me from just copying the data. But the main reason that I picked the hybrid upgrade solution in the first place was the fact that I specifically wanted to revisit and improve all old templates and components.
It was a fair amount of work, but the Magnolia engine for the Tricode website is completely up-to-date again and you can see the result. Visually there are just some minor changes, but under the hood this website is completely new!
Martijn earned his credits as a Java developer long ago and likes to transfer his knowledge to enthusiastic developers. Where new technologies are concerned (provided they have an added value for the organization), Martijn is one of the pioneers within Tricode.
Magnolia has an amazing community of partners and clients, among them quite a few wordsmiths. From time to time, they put their expertise into blog posts and share them on this platform.
See all posts on Guest blogger