Skip to content

4. Update database

Some versions require updates to the database. Look through the list of database update scripts for MySQL and for PostgreSQL and find a script for the database version you are updating to.

Database version number

Database version number corresponds to the ezpublish-kernel version.

To find out which ezpublish-kernel version you have, after running composer update or composer install run composer show ezsystems/ezpublish-kernel|grep versions.

During database update, you have to go through all the changes between your current version and your final version e.g. during update from v2.2 to v2.5 you have to perform all the steps from: <2.3, <2.4 and <2.5.

Start with the version closest to your current version:

Only after applying all changes your database will work properly.

Caution

Always back up your data before running any database update scripts.

After updating the database, clear the cache.

Do not use --force argument for mysql / psql commands when performing update queries. If there is any problem during the update, it is best if the query fails immediately, so you can fix the underlying problem before you execute the update again. If you leave this for later you risk ending up with an incompatible database, though the problems might not surface immediately.