Forest header image

Symfony Finland
Random things on PHP, Symfony and web development

eZ Publish 4.x to 5.x Upgrade Paths

In November 2014 the last versions of eZ Publish were released (5.4 and 2014.11). This is the last version of the fully featured Open Source Content Management System, whose code base dates back to 2002. From this version onwards the legacy code is no longer included with the standard distribution and the product will be known as eZ Platform.

Despite eZ Publish is being phased out, it will be maintained all the way to 2021 and will not be an obsolete product. The eZ Publish 5 series has a dual kernel approach towards compatibility. The legacy (4.x) branch is included in eZ Publish 5, but it's being accessed through a modern layer built with the Symfony 2 Framework.

This effort has taken a toll on the development team and eZ Publish 5.x has given very little new features to end users, instead focusing on developer improvements for the launch of eZ Platform. These investments give business little incentive to prompt for an upgrade themselves. Instead developers need to push an upgrade, but using security and future proofing are powerful arguments: Keeping your eZ Publish 5.x & it's Symfony install secure

This article discusses some of the technical benefits of an upgrade from eZ Publish 4.x to eZ Publish 5. eZ Platform is scheduled for release in 2015, but as you'll discover it's no excuse not to upgrade. eZ Publish is a heavy weight tool content management tool with a typical installation having multiple integrations.

These are the kind of things that are not re-written overnight in a big bang release. But this is exactly what eZ Publish 5 is good at. It's also a solid way of getting started with eZ Platform development before the product hits 1.0. So let's look at three ways to run eZ Publish 5:

  • Full Legacy
  • Legacy Mode
  • Hybrid

eZ Publish 5 Full Legacy

Running eZ Publish in full legacy mode means that you configure you document root to the ezpublish_legacy. This is essentially an installation of eZ Publish 4.9999999999999. It will in exactly the same way as eZ Publish 4 runs. It's a drop-dead simple way of upgrading, but offers no advantage to developers or any improved upgrade path to eZ Platform.

eZ Publish 5 Legacy Mode

In eZ Publish 5 Legacy Mode all traffic is routed through the Symfony Framework, but sites configured to run in this mode will route requests to the Legacy Kernel early on. This way legacy compatibility is at a high level, but you can add new sites that will run on the eZ Platform kernel.

The 5.x administration interface runs in this mode and proves that is a very solid method. Some configurations, etc. are injected to the legacy kernel (Legacy Kernel Injection), but most of the work is done by the legacy kernel. Running in Legacy Mode requires no changes to templates and allows creation of new Symfony based applications and eZ Platform sites to your installation.

This method has some limitations on using eZ Platform kernel features such as the HTTP layer, so it is an improvement but not ideal.

eZ Publish 5 Hybrid

The best way of modernising an existing eZ Publish 4 installation is the hybrid model. With a reasonable amount (typically) of work you can run your old templates, but leverage features from the modern stack transparently. This requires porting the main layouts (pagelayout.tpl) of your applications from the eZ Publish 4 templating language to Twig.

Technically you could any templating language supported by the Symfony Framework, such as HAML. But without a pressing reason I would stick with Twig. In hybrid mode you can reuse your legacy templates from the main layout by including. So you'll need to go ahead rewrite any of the old control structures in you legacy template, but in my experience for a well built eZ Publish 4 design it's usually a few hours of work. Your mileage may vary.

So what do you get for this investment? A lot! Now that all traffic runs through the Symfony Framework Kernel you get:

Probably with days of effort you can teleport your 2007 site to 2015 with a full REST API running on the Symfony HttpKernel, fully user context cached using Varnish. How's that for Backwards Compatibility? Pas mal, non?

What is the best upgrade path?

As for the version of eZ Publish 5 you should upgrade, there is no question - eZ Publish 5.4 and 2014.11 are very stable releases. I can't think of any excuse to go for 5.3 from a 4.x series release.

For your site upgrade path, it depends. Full Legacy is hyper safe, Legacy Mode is very safe and Hybrid is safe. These are all quite conservative options, but here are a few scenarios:

  • For complex sites that are no longer in active development you might just want to go with Full Legacy
  • For a site that has a complete redesign looming in the horizon, Legacy Mode will allow a smooth transition to a completely new Modern Stack implementation in the future
  • For sites in continuous development, I would go with a Hybrid

In addition to technical improvements, the Hybrid approach is also motivating for developers wanting to learn new technologies. Once you've done the upgrade, you've got your old eZ Publish site and a full Symfony Framework application development environment at your disposal.

Written by Jani Tarvainen on Saturday August 15, 2015
Permalink - Tags: ezplatform, ez, php, symfony

« Symfony has no model, but many - The Reverse Sandbox Effect in Google »