Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Migration recipes

Twenty-five task pages for migrations in Exponential 6.0.15, each with what you will have at the end, the steps and their output, the complete PHP migration, how to check it, how to take it back and the next step - from…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/migrations/recipes/README.md

On this page

Migration recipes

Each recipe is one task, written the same way: what you'll have at the end, the steps with the commands and their output, the complete migration, how to check it, how to roll it back, and the next step. They assume Exponential 6.0.15 with the record tables (./console exp:upgrade:status shows 6.0.15-migration-tables as done) and a development installation in a git checkout. New to migrations? Do the tutorial first; it takes about 20 minutes.

The database schema

RecipeYou will have
Add a database tablea table of your own on every engine, created from a .dba-style definition
Add a column or an indexa new column and index on an existing table, written by each engine's schema handler
Engine noteswhat differs between MySQL/MariaDB, PostgreSQL, SQLite, Oracle and MongoDB

Content classes and content

RecipeYou will have
Create or change a content classa content class with its attributes and class group, created or extended on every installation
Add a class attributea new attribute on an existing class, with the objects that exist initialized
Change content in bulkmany objects updated and published in one migration, found by class and subtree
Fix dataa correction of wrong data, written so it is safe on every installation
Seed content for a new sitethe folders and pages a new site starts with, found again by remote id
Large data migrationsa long migration in batches that can be resumed after an interruption

Settings, roles and policies

RecipeYou will have
Move or rename INI settingsa setting moved in settings/override, with its old value kept and a way back
Add roles and policiesa role with its policies, assigned to a user group by remote id

Where migrations live and run

RecipeYou will have
Per-environment migrationsmigrations limited to development, staging or production with the header line environments:
Migrations in an extension or a packagemigrations shipped in an extension or an installed package, ordered with the site's
Upgrade step or migration?the right tool for each change, and a migration that requires a kernel upgrade step

Quality

RecipeYou will have
Writing a reversible down()a down() that really undoes up(), and proof that it does
Testing migrationsthe lint in CI, a simulation with a diff, and a PHPUnit test on SQLite
Reviewing a migrationa checklist for the code review of a migration

Teams and delivery

RecipeYou will have
Team workflow with gitbranches, ordering, requires: and merge conflicts handled
Deploying with migrationsa pipeline (with a GitHub Actions example) that checks and applies migrations
Pushing tagsevery run committed, tagged and pushed, and failed pushes caught up

Safety and the record

RecipeYou will have
Captions and rollback in practicea failed run restored, a run and a migration taken back
The audit trail of runsthe answer to "what ran where, when and by whom"

Coming from another tool

RecipeYou will have
Coming from Doctrine Migrationsthe Doctrine commands and classes mapped to Exponential's
Coming from the Kaliop migration bundleKaliop YAML steps written as PHP migrations
Coming from SQL update filesa hand-written update file turned into a recorded, engine-aware migration

YAML migrations

Coming with the YAML engine. Recipes for migrations written as YAML steps will be listed here when the YAML engine lands. In 6.0.15 every recipe is written in PHP.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x