PHPackages                             aureka/migrate-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. [Database &amp; ORM](/categories/database)
4. /
5. aureka/migrate-bundle

ActiveLibrary[Database &amp; ORM](/categories/database)

aureka/migrate-bundle
=====================

Provides an initial scaffolding for building migrations

010PHP

Since Jun 19Pushed 11y ago5 watchersCompare

[ Source](https://github.com/aureka/MigrateBundle)[ Packagist](https://packagist.org/packages/aureka/migrate-bundle)[ RSS](/packages/aureka-migrate-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MigrateBundle
=============

[](#migratebundle)

[![Build Status](https://camo.githubusercontent.com/291aa4234f4c1893f20c598edbb70088f688061010a11a722b69f306b60bbc40/68747470733a2f2f7472617669732d63692e6f72672f617572656b612f4d69677261746542756e646c652e706e67)](https://travis-ci.org/aureka/MigrateBundle)

Provides a little scaffolding for migrations.

Configuration
-------------

[](#configuration)

1.- Add the bundle to your composer.json file and execute `composer update`.

```
{
    "require": {
        "aureka/migrate-bundle": "*"
    }
}
```

2.- Modify your `AppKernel.php`

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Aureka\MigrateBundle\AurekaMigrateBundle(),
            );
        // ...
    }
}
```

3.- Configure your legacy database in `config.yml`

aureka\_migrate: database: connector: 'mysqli' host: 'localhost' user: 'root' password: '123' database: 'my\_database'

Adding migrators
----------------

[](#adding-migrators)

It is time for you to add your custom migrators. Declare each migrator as a service tagged by `aureka_migrate.migrator`.

```
services:
    your_migration_bundle.users_migrator:
            class: Your\MigrationBundle\Migrator\UsersMigrator
            arguments: ['@aureka_migrate.legacy_connection', '@doctrine.orm.entity_manager']
            tags:
                - { name: aureka_migrate.migrator }
```

A migrator could be something like this:

```
use Doctrine\Common\Persistence\ObjectManager;

use Aureka\MigrateBundle\Migrator\Migrator,
    Aureka\MigrateBundle\Service\Database\Connection;

class UsersMigrator implements Migrator
{
    private $legacyConnection;
    private $om;

    public function __construct(Connection $legacyConnection, ObjectManager $om)
    {
        $this->legacyConnection = $legacyConnection;
        $this->om = $om;
    }

    public function prepare()
    {
        // Do whatever you need to prepare the migration, like cleaning the destination tables
        return $this;
    }

    public function migrate()
    {
        $users = $this->legacyConnection->fetchAll('SELECT * FROM users');
        foreach ($users as $legacy_user) {
            $user = new User;
            $user->name = $legacy_user['username'];
            // ...
            $this->om->persist($user);
        }
        $this->om->flush();
        return $this;
    }
```

Running migrations
------------------

[](#running-migrations)

Now you can execute the following command:

```
php app/console aureka_migrate:migrate
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2a85fbd3df7cb8270d08d62ca42ba012b02cad5ff2a146dcc544ca658f92689?d=identicon)[carlescliment](/maintainers/carlescliment)

---

Top Contributors

[![carlescliment](https://avatars.githubusercontent.com/u/1255401?v=4)](https://github.com/carlescliment "carlescliment (11 commits)")

### Embed Badge

![Health badge](/badges/aureka-migrate-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/aureka-migrate-bundle/health.svg)](https://phpackages.com/packages/aureka-migrate-bundle)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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