June 27, 2017
by Serhey Dolgushev
We had eZ Publish 4.3 website with DFS cluster and wanted to move it to a Production Standard platform.sh instance. The main steps in this process are:
Our project does not using any custom rewrite rules, that’s why our routes definition file is the simplest possible:
We are not using SOLR on our project, so MySQL was the only other service needed. But we were using a separate database for DFS clusterization on our previous hosting platform, and we wanted to keep it. That’s why we need two databases on platform.sh: main and cluster. In this case the services definition file looks like:
It looks pretty simple and please feel free to ask a question in comments or check platform.sh Database service documentation if you have some questions about it.
The last remaining configuration file is the application definition file, which is .platform.app.yaml.
In our case the application definition file was the following:
Some comments about it:
Platform.sh assumes that application will read service configurations from PLATFORM_RELATIONSHIPS environmental variable. But eZ Publish Legacy does not have any built-in functionality for doing this. That’s why we came up with our solution: override eZINI class and implement some custom code to read configurations from the environment variable. In order to implement it, you need to:
After these steps the database settings are extracted from PLATFORM_RELATIONSHIPS environment variable and injected into site.ini and file.ini configuration files. Please note, you will need to modify this code if you are using SOLR or trying to inject settings to eZ Publish legacy for any other platform.sh services.
This is probably the simplest step - you just need to follow platform.sh suggestions. In two words: platform.sh provides you a git repository for the project. You should add that repository as an additional origin. Each time you push the master branch to that origin, the application is build and deployed on platform.sh.
If you are using git submodules (which is quite common phenomenon for eZ Publish Legacy projects), you need to add platform.sh deploy key to list of your SSH keys on Github/Gitlab/Bitbucket/etc. You can find it on configure project page, DEPLOY KEY tab.
We hope this blog post was useful for you! If you have any questions, please contact us or leave a comment.