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:expmigrationrollback

Take migrations back: a run (its caption restored), one migration (its down()) or, for experts, any caption; a dry run unless --apply.

Download as PDF

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

On this page

exp:expmigrationrollback

Take migrations back: a run (its caption restored), one migration (its down()) or, for experts, any caption; a dry run unless --apply.

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

./console exp:expmigrationrollback --help
./console exp:migration:rollback --help
php bin/php/expmigrationrollback.php --help

Help text

Take migrations back
The argument names what to take back, found in this order:
  a run id         the caption taken before the run is restored (exp:upgrade's rollback: a safety
                   caption of the current state first, then database, storage and settings)
  a migration id   its down(), when it has one; the record of it is removed
  a caption id     any earlier caption, for experts: --expert --confirm=<the caption id>
Without --apply it lists what would be restored or undone. Oracle has no built-in restore: the
command prints the steps to restore by hand.

./console exp:migration:rollback 20261031-120000-a1b2c3
./console exp:migration:rollback 20261031-120000-a1b2c3 --apply
./console exp:migration:rollback 20261031120000_add_news_class --apply
./console exp:migration:rollback 2026-10-29_10-15-00 --expert --confirm=2026-10-29_10-15-00 --apply

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
--formatrequiredtext (default) or json (the machine output exp-migration/1)
--sourcerequiredThe source: site or extension:<name> (generate: where the file goes; rollback: which migration, when two sources have its id)
--environmentrequiredThe environment (default the installation's: [AdminEnvironment] Level, or EXP_ENV with Level=auto; check: every environment); only the migrations for it count
--loginrequiredRun as this user (default: [RunSettings] RunAsUser of migration.ini)
--expertRestore a caption that is not the one taken before a run (with --confirm)
--confirmrequiredThe id of the caption typed again, to restore it with --expert
--partsrequiredOnly these parts of the caption, a comma list of database, storage, settings, libraries, code (default [CaptionSettings] RestoreParts)
--backup-dirrequiredWhere the captions made without git_manager are (default var/backup/upgrade)
--no-safety-captionRestore without taking a caption of the current state first; refused on production without --force-no-caption
--force-no-captionWith --no-safety-caption on a production installation: restore without a caption all the same
--no-verifySkip the verification after the restore
--progressrequiredAppend the progress of the run to this file, one JSON object per line (what the administration shows while the run goes on)

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 ...).

Arguments: [target].


Generated by ./console exp:help:examples from bin/php/expmigrationrollback.php, kernel/private/classes/commands/expmigrationrollback.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