This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Data migration API¶
You can use the PHP API to manage and run data migrations.
Getting migration information¶
To list all migration files available in the directory defined in configuration (by default, src/Migrations/Ibexa
), use the MigrationService:listMigrations()
method:
1 2 3 |
|
To get a single migration file by its name, use the MigrationService:findOneByName()
method:
1 |
|
Running migration files¶
To run migration file(s), use either MigrationService:executeOne()
or MigrationService:executeAll()
:
1 2 |
|
Both executeOne()
and executeAll()
can take an optional parameter: the login of the User that you want to execute the migrations as.
Adding new migrations¶
To add a new migration file, use the MigrationService:add()
method:
1 2 3 4 5 6 |
|