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 --helpHelp 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 --applyOptions
| Option | Value | Help |
|---|---|---|
--apply | Make the changes (the default is a dry run that lists them and changes nothing) | |
--dry-run | The default, accepted for scripts that pass it: list what would change, change nothing | |
--format | required | text (default) or json (the machine output exp-migration/1) |
--source | required | The source: site or extension:<name> (generate: where the file goes; rollback: which migration, when two sources have its id) |
--environment | required | The environment (default the installation's: [AdminEnvironment] Level, or EXP_ENV with Level=auto; check: every environment); only the migrations for it count |
--login | required | Run as this user (default: [RunSettings] RunAsUser of migration.ini) |
--expert | Restore a caption that is not the one taken before a run (with --confirm) | |
--confirm | required | The id of the caption typed again, to restore it with --expert |
--parts | required | Only these parts of the caption, a comma list of database, storage, settings, libraries, code (default [CaptionSettings] RestoreParts) |
--backup-dir | required | Where the captions made without git_manager are (default var/backup/upgrade) |
--no-safety-caption | Restore without taking a caption of the current state first; refused on production without --force-no-caption | |
--force-no-caption | With --no-safety-caption on a production installation: restore without a caption all the same | |
--no-verify | Skip the verification after the restore | |
--progress | required | Append 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].
Related
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.