PHPackages                             kreait/ezpublish-migrations-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kreait/ezpublish-migrations-bundle

Abandoned → [kaliop/ezmigrationbundle](/?search=kaliop%2Fezmigrationbundle)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

kreait/ezpublish-migrations-bundle
==================================

Migrations for eZ Publish/eZ Platform

4.0(10y ago)177.7k6MITPHP

Since May 8Pushed 8y ago2 watchersCompare

[ Source](https://github.com/kreait/ezpublish-migrations-bundle)[ Packagist](https://packagist.org/packages/kreait/ezpublish-migrations-bundle)[ Docs](https://github.com/kreait/ezpublish-migrations-bundle)[ RSS](/packages/kreait-ezpublish-migrations-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (4)Versions (17)Used By (0)

eZ Publish/Platform Migrations
==============================

[](#ez-publishplatform-migrations)

Migrations for eZ Publish/Platform.

Abandoned/Archived: This bundle hasn't received updates since 2016, is far behind the current development of eZ Publish/Platform, and thus has been marked as archived/abandoned. Please switch to [kaliop/ezmigrationbundle](https://github.com/kaliop-uk/ezmigrationbundle).

Features
--------

[](#features)

In addition to the commands from the [DoctrineMigrationsBundle](http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html), this bundle gives you an additional `ezpublish:migrations:generate` command, which generates a Migration that eases eZ Publish/Platform related changes.

- Automatically sets the active eZ user performing the changes (default: `admin`)
- Allows the quick change of the currently active user, e.g. for creating new content in the name of a certain user.
- Adds a shorthand method to create new content

If you know Doctrine Migrations, you will feel right at home.

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Known Issues](#known-issues)
- [Alternatives](#alternatives)

Installation
------------

[](#installation)

```
composer require kreait/ezpublish-migrations-bundle
```

Enable the DoctrineMigrationsBundle and the KreaitEzPublishMigrationsBundle in `AppKernel.php` (eZ Platform) or `EzPublishKernel.php` (eZ Publish 5):

```
public function registerBundles()
{
    $bundles = array(
        //...
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
        new Kreait\EzPublish\MigrationsBundle\KreaitEzPublishMigrationsBundle(),
    );
}
```

### Configuration

[](#configuration)

You can configure the bundles in your `config.yml`. The examples below are the default values.

```
doctrine_migrations:
    dir_name: "%kernel.root_dir%/DoctrineMigrations"
    namespace: Application\Migrations
    table_name: migration_versions
    name: Application Migrations

ezpublish_migrations:
    # The login name of the user performing the migrations.
    ez_migrations_user: admin

```

Usage
-----

[](#usage)

The usage is [identical to Symfony's DoctrineMigrationBundle](http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html), with the addition of the following command:

```
# Generate a blank eZ Publish/Platform enabled migration class
$ ezpublish:migrations:generate
```

You can access the eZ Repository inside a migration with `$this->repository`.

See [src/Resources/doc/examples](src/Resources/doc/examples) eZ Publish related example migrations.

### Helper methods

[](#helper-methods)

#### Changing the current migration user during a migration

[](#changing-the-current-migration-user-during-a-migration)

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

```
// All subsequent calls will be made as the user with the given name
$this->changeMigrationUser('another_username');
```

and restore the default Migration user by using:

```
// Restores the current user to the configured migrations user.
$this->restoreDefaultMigrationUser();
```

#### Quickly create simple content

[](#quickly-create-simple-content)

```
$this->createContent($parentLocationId, $contentTypeIdentifier, $languageCode, array $fields);
```

see [Create new content example](src/Resources/doc/examples/03-create-new-content.md)

Known issues
------------

[](#known-issues)

When you create a migration using only eZ Publish's API methods, no SQL statements are executed in terms of the DoctrineMigrationsBundle. This results in the following message:

`Migration was executed but did not result in any SQL statements.`

Alternatives
------------

[](#alternatives)

- [kaliop/ezmigrationbundle](https://github.com/kaliop-uk/ezmigrationbundle) is a high level bundle that lets you define content migrations in YAML files.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Total

15

Last Release

3728d ago

Major Versions

1.3 → 2.02015-08-02

2.0.3 → 3.02015-12-13

3.0.1 → 4.02016-02-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/8685cf532053a084f1eade7b7da00a512c02676e65f1f1bdec73d4978030a47d?d=identicon)[jeromegamez](/maintainers/jeromegamez)

---

Top Contributors

[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (69 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")

---

Tags

ez-platformezpublishmigrationsphpmigrationsezpublishezplatform

### Embed Badge

![Health badge](/badges/kreait-ezpublish-migrations-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kreait-ezpublish-migrations-bundle/health.svg)](https://phpackages.com/packages/kreait-ezpublish-migrations-bundle)
```

###  Alternatives

[netgen/remote-media-bundle

Remote media field type implementation

189.4k4](/packages/netgen-remote-media-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
