Migrations for eZ Publish 5

Installs: 1 220

Dependents: 0

Stars: 14

Watchers: 5

Forks: 6

Open Issues: 1

2.0.2 2015-08-03 15:04 UTC


Latest Stable Version License Build Status Code Coverage Scrutinizer Code Quality Gitter

Migrations for eZ Publish 5, based on Doctrine Migrations, very similar to Symfony's DoctrineMigrationsBundle.


composer require kreait/ezpublish-migrations-bundle


Enable the bundle in EzPublishKernel.php by including the following:

// ezpublish/EzPublishKernel.php
public function registerBundles()
    $bundles = array(
        new Kreait\EzPublish\MigrationsBundle\KreaitEzPublishMigrationsBundle(),

You can configure the path, namespace, table_name and name in your config.yml. The examples below are the default values.

// ezpublish/config/config.yml
    dir_name: "%kernel.root_dir%/EzPublishMigrations"
    namespace: Application\Migrations
    table_name: ezmigration_versions
    name: Application Migrations
    ez_user: admin


All of the migrations functionality is contained in the following commands:

  :execute  Execute a single migration version up or down manually.
  :generate Generate a blank migration class.
  :migrate  Execute a migration to a specified version or the latest available version.
  :status   View the status of a set of migrations.
  :version  Manually add and delete migration versions from the version table.

The usage is identical to Symfony's DoctrineMigrationBundle, except for the missing :diff command. Please have a look at the official documentation for further information.

Changing the current migration user during a migration

You can change the current eZ Publish user inside a migration by issuing the following command:


and restore the default Migration user by using:


Usage examples

See src/Resources/doc/examples for some usage examples.