Skip to the content
Documentation

exp:expmigrationconvert

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

Convert YAML migrations of the migration bundle of the Symfony based platform into YAML migrations of Exponential: a file or every .yml file of a folder, step by step, what does not convert listed at the top of the new file; a dry run unless --apply

Usage

./console exp:expmigrationconvert [options]
php bin/php/expmigrationconvert.php [options]
./console exp:migration:convert [options]

Aliases

exp:migration:convert

Help

The output of ./console help exp:expmigrationconvert (the script run with --help), without the standard options:

Usage: bin/php/expmigrationconvert.php [OPTION]... [FILE]
Convert migrations of the migration bundle of the Symfony based platform
Reads a YAML migration of the bundle (a list of steps with type, mode, match, attributes and
references), or every .yml and .yaml file of a folder, and writes a YAML migration of Exponential
for each: content, content_type, content_type_group, location, role, section, user, user_group,
language, tag, sql, reference and trash steps convert; "reference:<name>" becomes ${ref.<name>}.
What does not convert (PHP and service calls, HTTP, mail, processes, loops, files, keys without a
counterpart) is never guessed: it is listed at the top of the new file, to be done by hand. Every
converted step is checked by its step type. The new file keeps the date and time of the old name and
goes into the site's migrations directory or, with --source=extension:<name>, the extension's. Without
--apply it shows the files and writes nothing; an existing file is never replaced.

./console exp:migration:convert var/import/20240115093000_create_news_folder.yml
./console exp:migration:convert var/import/MigrationVersions --apply
./console exp:migration:convert var/import/MigrationVersions --source=extension:expnews --apply


Options:
  --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=VALUE  text (default) or json (the machine output exp-migration/1)
  --source=VALUE  The source: site or extension:<name> (generate: where the file goes; rollback: which migration, when two sources have its id)
  --author=VALUE  The author in the header of the new migration

Options

Option Value Description
--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)
--author required The author in the header of the new migration

Arguments

[file]

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/expmigrationconvert.php, kernel/private/classes/commands/expmigrationconvert.php

See also

Generated example: exp:expmigrationconvert

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.