Migrating from eZ Publish Platform¶
eZ Publish Platform (5.x) was a transitional version of the eZ CMS, bridging the gap between the earlier generation called eZ Publish (sometimes referred to as legacy), and the current eZ Platform and eZ Platform Enterprise Edition for developers.
eZ Publish Platform introduced a new Symfony-based technology stack that could be run along the old (legacy) one. This bridging is still possible using something called Legacy Bridge, an optional package for eZ Platform. This fluid change allows eZ Publish users to migrate to eZ Platform gradually, using the bridging as an intermediary stepping stone.
An upgrade from eZ Publish Platform 5.4.x (Enterprise edition) or 2014.11 (Community edition) to newer versions of eZ Platform must be performed in stages.
You can upgrade from eZ Publish Platform directly to the v1.7 LTS release. You can then proceed with consecutive upgrades to further versions: v1.13 LTS and 2.x.
Things to be aware of when planning a migration
While the instructions below are fully supported, we are aware that the community, partners and customers come from a wide range of different versions of eZ Publish, some with issues that do not surface before attempting a migration. That's why we and the community are actively gathering feedback on Slack and/or support channels for Enterprise customers to gradually improve the migration scripts and instructions. Reach out before you start so others who have done this before you can support you.
As of eZ Platform v1.11, Legacy Bridge is a supported option for 1.x and future 2.x series. This means you can plan for a more gradual migration if you want, just like you could on eZ Publish Platform 5.x, with a more feature-rich version of eZ Platform and (with 2.x) also more recent version of Symfony. This is a great option for those who want the latest features and are comfortable with more frequent releases.
Additionally there are some other topics to be aware of for the code migration from eZ Publish to eZ Platform:
- Symfony deprecations. The recommended version to migrate to is eZ Platform v2.5 LTS, which is using Symfony 3.4 LTS.
- Field Types reference for overview of Field Types that do and don't exist in eZ Platform
- API changes. While we have a strict backwards compatibility focus, some deprecated API features were removed and some changes were done to internal parts of the system. See ezpublish-kernel:doc/bc/changes-6.0.md
If you are migrating from a legacy eZ Publish version, this page contains the information you need. However, first have a look at an overview of the process in Migrating from eZ Publish.
This section describes how to upgrade your existing eZ Publish Platform 5.4/2014.11 installation to eZ Platform and eZ Enterprise. Make sure that you have a working backup of the site before you do the actual upgrade, and that the installation you are performing the upgrade on is offline.
Note on Paths¶
<old-ez-root>/: The root directory where the 5.4/2014.11 installation is located in, for example:
<new-ez-root>/: The root directory where the installation is located in, for example:
Check for requirements¶
- Information regarding system requirements can be found on the Requirements documentation page; notable changes include:
- PHP 7.1 or higher
- MariaDB or MySQL 5.5 or higher (Postgres possible for upgrades, but not yet supported by the installer for new installations)
- Browser from 2017 or newer for use with eZ Platform backend UI
- This page assumes you have composer installed on the machine and that it is a recent version.
Step 1: Extract eZ Platform/Enterprise v1.7¶
The easiest way to upgrade the distribution files is to extract a clean installation of eZ Platform / eZ Enterprise to a separate directory.
Step 2: Move over code and config¶
If you have code in src folder, move that over:
<old-ez-root>/src => <new-ez-root>/src
2.2.1 Move over own packages¶
Assuming you have own composer packages (libraries and bundles, but not eZ Publish legacy packages), execute commands like below to add them to new install in
composer require --no-update "vendor/package:~1.3.0"
Adapt the command with your
package, version number, and add
"–dev" if a given package is for dev use. Also check if there are other changes in
composer.json you should move over.
2.2.2 Install XmlText Field Type¶
While no longer bundled, the XmlText Field Type still exists and is needed to perform a migration from eZ Publish's XmlText to the new docbook-based format used by the RichText Field Type. If you plan to use Legacy Bridge for a while before migrating content, you'll also need this for rendering content with XMLText. From
composer require --no-update "ezsystems/ezplatform-xmltext-fieldtype:^1.3.0"
As of v1.3, be aware this Field Type now uses the Content View system introduced in eZ Platform 1.0, so make sure you adapt custom templates and override rules if you plan to use this for rendering content (in Legacy Bridge setup).
To move over your own custom configurations, follow the conventions below and manually move the settings over:
<old-ez-root>/ezpublish/config/parameters.yml => <new-ez-root>/app/config/parameters.yml
- For parameters like before, for new parameters you'll be prompted on later step.
<old-ez-root>/ezpublish/config/config.yml => <new-ez-root>/app/config/config.yml
- For system/framework config, and for defining global db, cache, search settings.
<old-ez-root>/ezpublish/config/ezpublish.yml => <new-ez-root>/app/config/ezplatform.yml
- For SiteAccess, site groups and repository settings.
Changes to repository configuration
When moving configuration over, be aware that as of 5.4.5 and higher, repository configuration has been enhanced to allow configuring storage engine and search engine independently.
1 2 3 4 5 6 7 8 9 10 11
Make sure to adapt SiteAccess names
In the default configurations in ezplatform.yml you'll find existing SiteAccesses like
site, and depending on installation perhaps a few others, all under a site group called
site\_group. Make sure to change those to what you had in ezpublish.yml to avoid issues with having to log in to your website, given user/login policy rules will need to be updated if you change names of SiteAccess as part of the upgrade.
2.3.1 Image aliases¶
Image aliases defined in legacy must also be defined for eZ Platform. Since image aliases in legacy may be scattered around
image.ini files in various extensions, you may find it easier to find all image alias definitions using
the legacy admin (Setup > Ini settings).
See Image documentation page for information about how to define image aliases.
For an example, see a legacy image alias defined as follows in
1 2 3 4 5 6 7 8 9
The corresponding image alias configuration for eZ Platform would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Move over registration of your bundles you have from src and from composer packages, from old to new kernel:
<old-ez-root>/ezpublish/EzPublishKernel.php => <new-ez-root>/app/AppKernel.php
2.5. Optional: Install Legacy Bridge¶
If you don't plan to migrate content directly to newer eZ Platform Field Types, you can optionally install Legacy Bridge and gradually handle code and subsequent content migration afterwards. For installation instructions see here.
The Legacy Bridge integration does not have the same performance, scalability or integrated experience as a pure Platform setup. Like on eZ Publish Platform 5.x there are known edge cases where, for instance, cache or search index won't always be immediately updated across the two systems using the bridge. This is one of the many reasons why we recommend a pure Platform setup where that is possible.
2.5.1 Set up symlinks for legacy folders¶
As eZ Publish legacy is installed via composer, we need to take care of placing some files outside its generated
<new-ez-root>/ezpublish_legacy/ folder, and for instance use symlink to place them inside during installation.
For design and settings files that you typically version in git, you can now take advantage of Legacy Bridge's built-in symlink convention. So as installation already hinted about, you can generate a structure and set up symlinks using
bin/console ezpublish:legacy:symlink -c. This will create folders you can use below in
The same goes for the
<new-ez-root>/ezpublish_legacy/var/[<site>/]storagefolder. However, as it is typically not versioned in git, there's no predefined convention for this. If you create a folder within your project structure for symlinking into this folder, as opposed to a mount somewhere else, make sure to mark this folder as ignored by git once it and the corresponding
.keepfile have been added to your checkout. The example below will assume
<new-ez-root>/src/legacy_files/storagewas created for this purpose, if you opt for something else just adjust the instructions.
2.5.2 Upgrade the legacy distribution files¶
The easiest way to upgrade the distribution files is to copy the directories that contain site-specific files from the existing 5.4 installation into
/<ezplatform>/ezpublish_legacy. Make sure you copy the following directories:
- Do NOT include built-in designs: admin, base, standard or admin2
- Other folders to move over (or potentially set up symlinks for) if applicable:
- ezpublish_legacy/extension/* (do NOT include the built-in / composer provided ones, like: ezflow, ezjscore, ezoe, ezodf, ezie, ezmultiupload, ezmbpaex, ez_network, ezprestapiprovider, ezscriptmonitor, ezsi, ezfind)
- ezpublish_legacy/config.php and ezpublish_legacy/config.cluster.php
Since writable directories and files have been replaced / copied, their permissions might have changed. You most likely need to reconfigure webserver user permissions as instructed further down.
2.6 Binary files¶
Binary files can simply be copied from the old to the new installation:
<old-ez-root>/web/var[/<site_name>]/storage => <new-ez-root>/web/var[/<site_name>]/storage
In the eZ Publish Platform 5.x installation
web/var is a symlink to
ezpublish_legacy/var, so if you can't find it in path above you can instead copy the storage files to the similar
2.7 Re-apply permissions and update composer¶
Since writable directories and files have been replaced / copied, their permissions might have changed. You need to re-apply them.
When that is done, execute the following to update and install all packages from within
composer update --prefer-dist
At the end of the process, you will be asked for values for parameters.yml not already moved from old installation, or new (as defined in parameters.yml.dist).
2.8 Register EzSystemsEzPlatformXmlTextFieldTypeBundle¶
Add the following new bundle to your new kernel file,
Step 3: Upgrade the database¶
3.1. Execute update SQL¶
Import to your database the changes provided in one of the following files. It's also recommended to read inline comments as you might not need to run some of the queries:
3.2. Once you are ready to migrate content to Platform Field Types¶
Steps here should only be done once you are ready to move away from legacy and Legacy Bridge, as the following Field Types are not supported by legacy. In other words, content you have migrated will not be editable in legacy admin interface anymore, but rather in the more modern eZ Platform back-end UI, allowing you to take full advantage of what the Platform has to offer.
3.2.1 Migrate XmlText content to RichText¶
You should test the XmlText to RichText conversion before you apply it to a production database. RichText has a stricter validation compared to XmlText and you may have to fix some of your XmlText before you are able to convert it to RichText. Run the conversion script on a copy of your production database as the script is rather resource-intensive.
php -d memory_limit=1536M bin/console ezxmltext:convert-to-richtext --dry-run --export-dir=ezxmltext-export --export-dir-filter=notice,warning,error --concurrency 4 -v
-d memory_limit=1536Mspecifies that each conversion process gets 1536MB of memory. This should be more than sufficient for most databases. If you have small
ezxmltextdocuments, you may decrease the limit. If you have huge
ezxmltextdocuments, you may need to increase it. See PHP documentation for more information about the memory_limit setting.
--dry-runprevents the conversion script from writing anything back to the database. It just tests if it is able to convert all the
--export-dirspecifies a directory where it will dump the
ezxmltextfor content object attributes which the conversion script finds problems with
--export-dir-filterspecifies what severity the problems found needs to be before the script dumps the
ezxmltextcontains problems which the conversion tool was able to fix automatically and likely do not need manual intervention
warning: the conversion tool was able to convert the
richtext, but data could have been altered/removed/added in the process. Manual supervision recommended
ezxmltexttext cannot be converted and manual changes are required.
--concurrency 4specifies that the conversion script will spawn four child processes which run the conversion. If you have dedicated hardware for running the conversion, you should use concurrency level that matches the number of logical CPUs on your system. If your system needs to do other tasks while running the conversion, you should run with a smaller number.
-vspecifies verbosity level. You may increase the verbosity level by supplying
-vwill be sufficient in most cases.
The script also has an
--image-content-types option which you should use if you have custom image classes. With this option, you specify the content class identifiers:
php bin/console ezxmltext:convert-to-richtext --image-content-types=image,custom_image -v
The script needs to know these identifiers in order to convert
<ezembed> tags correctly. Failing to do so will prevent the editor from showing image thumbnails of embedded image objects. You may find the image Content Types in your installation by looking for these settings in
1 2 3
--image-content-types option is not specified, the default setting
image will be used.
Version of the migration script in ezplatform-xmltext-fieldtype prior to v1.6.0 would fail to convert embedded images correctly. If you have a database which you have already converted with an old version, you may rerun the
convert-to-richtext command with the following options:
php bin/console ezxmltext:convert-to-richtext --fix-embedded-images-only -v
The use of
--image-content-types is also supported together with
--fix-embedded-images-only. Use it to specify custom image Content Types.
There is no corresponding
ImagesClassList setting in eZ Platform. So even though you have customer image classes, you don't need to configure this in the eZ Platform configuration when migrating.
If you later realize that you provided the convert script with incorrect image Content Type identifiers, it is perfectly safe to re-execute the command as long as you use the
So, if you first ran the command:
php bin/console ezxmltext:convert-to-richtext --image-content-types=image,custom_image -v
But later realize the last identifier should be
custom_image, you may execute :
php bin/console ezxmltext:convert-to-richtext --image-content-types=image,profile -v
The last command would then ensure embedded objects with Content Type identifier
custom_image are no longer tagged as images, while embedded objects with Content Type identifier
Using the option
--export-dir, the conversion will export problematic
ezxmltext to files with the name pattern
[export-dir]/ezxmltext_[contentobject_id]_[contentobject_attribute_id]_[version]_[language].xml. A corresponding
.log file will also be created which includes information about why the conversion failed. Be aware that the reported location of the problem may not be accurate or may be misleading.
Below is an example of a xml dump,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
The corresponding log file,
1 2 3
The first log message is a notice about the
ez-temporary=1 attribute which the conversion tool simply will remove during conversion.
The second log message is an error, but the cause described may be confusing. During the conversion, the
<table> element will be converted to an
<informaltable> tag, which is problematic.
The exact problem in this case is the value of the second align attribute:
<td align="middle"....>. An align attribute may only have the following values:
In order to fix the problem, open the .xml file in a text editor and correct the errors:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Now, you may test if the modified
ezxmltext may be converted using the
php -d memory_limit=1536M bin/console ezxmltext:import-xml --dry-run --export-dir=ezxmltext-export --content-object=56554 -v
If the tool reports no errors, then the
ezxmltext is fixed. You may rerun the command without the
--dry-run option in order to actually update the database with the correct XmlText.
Once you have fixed all the dump files in
ezxmltext-export/, you may skip the
--content-object option and the script will import all the dump files located in the
php -d memory_limit=1536M bin/console ezxmltext:import-xml --export-dir=ezxmltext-export -v
Typical problems that needs manual fixing:
Duplicate xhtml IDs
Xhtml IDs needs to be unique. The following
ezxmltext will result in a warning:
1 2 3 4 5 6
The conversion tool will replace the duplicate id (
inv5) with a random value. If you need the ID value to match your CSS, you need to change it manually.
The conversion tool will also complain about IDs which contain invalid characters.
Links with non-existing
ezxmltext you may have links which refer to other objects by their remote ID. This is not supported in
richtext, so the conversion tool must look up such remote IDs and replace them with the
node_id. If the conversion tool cannot find the object by its remote id, it will issue a warning about it.
In older eZ Publish databases you may also have invalid links due to lack of reference to a target (no
When the conversion tool detects links with no reference it will issue a warning and rewrite the URL to point to current page (
When you are ready to migrate your eZ Publish XmlText content to the eZ Platform RichText format and start using pure eZ Platform setup, start the conversion script without the
--dry-run option. Execute the following from <new-ez-root>:
php -d memory_limit=1536M bin/console ezxmltext:convert-to-richtext --export-dir=ezxmltext-export --export-dir-filter=notice,warning,error --concurrency 4 -v
Custom tags and attributes
eZ Platform now supports custom tags, including inline custom tags, and limited use of custom tag attributes. After migrating to RichText, you need to adapt your custom tag config for eZ Platform and rewrite the custom tags in Twig. See Custom tag documentation for more info.
If you configured custom attributes in legacy in OE using ezoe_attributes.ini, note that not all types are supported.
Below is a table of the tags that are currently supported, and their corresponding names in eZ Platform.
3.2.2 Migrate Page field to Page (eZ Enterprise only)¶
If you use Page field (ezflow) and an eZ Enterprise subscription, and are ready to migrate your eZ Publish Flow content to the eZ Enterprise Page format, you can use a script to migrate your old Page content to new Page, to start using a pure eZ Enterprise setup. See Migrating legacy Page field (ezflow) to new Page (Enterprise) for more information.
3.2.3 Add other eZ Enterprise schemas (eZ Enterprise only)¶
For date-based publisher and form builder, there are additional tables, you can import them to your database using the following sql files:
Step 4: Re-configure web server and proxy¶
If you use Varnish, the recommended Varnish (4 or higher) VCL configuration can be found in the
doc/varnish folder. See also the Using Varnish page.
Web server configuration¶
The officially recommended virtual configuration is now shipped in the
doc folder, for both apache2 (
doc/apache2) and nginx (
doc/nginx). Both are built to be easy to understand and use, but aren't meant as drop-in replacements for your existing configuration.
As was the case starting 5.4, one notable change is that
SetEnvIf is now used to dynamically change rewrite rules depending on the Symfony environment. It is currently used for the assetic production rewrite rules.
Step 5: Link assets¶
Assets from the various bundles need to be made available for the webserver through the web/ document root. Execute the following commands from
Unstyled login screen after upgrade¶
It is possible that after the upgrade your admin screen will be unstyled. This may happen because the new SiteAccess will not be available in the database. You can fix it by editing the permissions for the Anonymous user. Go to Roles in the Admin Panel and edit the Limitations of the Anonymous user's user/login policy. Add all SiteAccesses to the Limitation, save, and clear the browser cache. The login screen should now show proper styling.
If your legacy site uses old-style URL aliases, to upgrade them successfully you need to apply a workaround to the slug converter. Where the slug converter service is defined, set second config parameter to use
urlalias_compat by adding a new argument to the existing settings:
1 2 3 4 5 6
In case of URLs with extended UTF-encoded names, the workaround must make use of
1 2 3 4 5
Migrating legacy Page field (ezflow) to new Page (Enterprise)¶
To move your legacy Page field / eZ Flow configuration to eZ Platform Enterprise Edition you can use a script that will aid in the migration process.
The script will automatically migrate only data – to move custom views, layouts, blocks etc., you will have to provide their business logic again.
The migration script will operate on your current database.
Make sure to back up your database in case of an unexpected error.
To use the script, do the following:
Make a note of the paths to .ini files which define your legacy blocks. You will need these paths later.
composer.json in your clean Platform installation.
3. Clear cache.
4. Run the script with the following parameters:
- absolute path of your legacy application
- list of .ini files which define your legacy blocks
Example of the migration script command
5. You will be warned about the need to create a backup of your database. Proceed only if you are sure you have done it.
MigrationBundle will be generated in the
You will see a report summarizing the results of the migration.
7. Clear cache again.
At this point you can already view the initial effects of the migration, but they will still be missing some of your custom content.
MigrationBundle generates placeholders for layouts in the form of frames with a data dump.
For blocks that could not be mapped to existing Page blocks, it will also generate PHP file templates that you need to fill with your own business logic.