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

exp:expmigrationmigrate

Run the pending migrations: a dry run unless --apply; captions before and after, restore on failure, commit, tag and push.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/commands/expmigrationmigrate.md

On this page

exp:expmigrationmigrate

Run the pending migrations: a dry run unless --apply; captions before and after, restore on failure, commit, tag and push.

Script bin/php/expmigrationmigrate.php, code in kernel/private/classes/commands/expmigrationmigrate.php. Run it from the installation root, as the user the web server runs as:

./console exp:expmigrationmigrate --help
./console exp:migration:migrate --help
php bin/php/expmigrationmigrate.php --help

Help text

Run the pending migrations
Without --apply a dry run: every pending migration with what it would change, nothing written.
With --apply, under the installation lock (shared with exp:upgrade) and as [RunSettings] RunAsUser:
the code trees are checked for changes that are not committed, a caption is taken, the migrations
run in order (each in a transaction where the database has one), the run stops at the first failure
and restores the caption, a caption is taken after a run that passed, and the status file and run log
are committed, tagged and pushed in the migrations repository. A migration whose file changed after
it was applied stops the run unless --force --reason=<text> accepts it.

./console exp:migration:migrate
./console exp:migration:migrate --apply
./console exp:migration:migrate --only=20261031120000_add_news_class --apply
./console exp:migration:migrate --path=extension/expnews/migrations --environment=staging --apply --no-push
./console exp:migration:migrate --apply --max-migrations=20 --max-time=600 --throttle=0.5 --nice=10

Options

OptionValueHelp
--applyMake the changes (the default is a dry run that lists them and changes nothing)
--dry-runThe default, accepted for scripts that pass it: list what would change, change nothing
--onlyrequiredOnly these migrations (migration ids, a comma list or repeated)
--pathrequiredMigration files or folders, relative to the root or absolute (a comma list or repeated): migrate and dry-run take only the migrations in them, check checks them instead of the migration directories
--environmentrequiredThe environment (default the installation's: [AdminEnvironment] Level, or EXP_ENV with Level=auto; check: every environment); only the migrations for it count
--formatrequiredtext (default) or json (the machine output exp-migration/1)
--loginrequiredRun as this user (default: [RunSettings] RunAsUser of migration.ini)
--no-captionNo caption before and after the run: a failure cannot be restored automatically
--no-restoreAfter a failure, leave the installation as the failure left it instead of restoring the caption taken before the run
--include-uncommittedRun although settings/, extension/ or design/ have changes that are not committed, and keep them in the caption
--no-commitDo not commit the status file and run log to the migrations repository (no tag and no push either)
--no-pushCommit and tag, but do not push
--no-tagCommit and push, but do not tag the run
--forceWith --reason: accept migrations whose file changed after they were applied (they are not run again)
--reasonrequiredWhy a changed migration is accepted (needed with --force; kept in the record and the audit log)
--run-idrequiredThe id of the run to start (default a new one: <date>-<time>-<6 hex digits>); the administration names it before it starts the run
--progressrequiredAppend the progress of the run to this file, one JSON object per line (what the administration shows while the run goes on)
--max-migrationsrequiredApply at most this many migrations; the rest stay pending for the next run (default [RunSettings] MaxMigrations, empty: all)
--max-timerequiredStart no further migration after this many seconds; the rest stay pending for the next run (default [RunSettings] MaxTime)
--throttlerequiredPause this many seconds between two migrations and between the batches of a long migration (default [RunSettings] Throttle)
--nicerequiredRun at this lower priority, 1 to 19 as nice(1) (default [RunSettings] Nice)

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/expmigrationmigrate.php, kernel/private/classes/commands/expmigrationmigrate.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

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