Drush core migrate commands integration refactor

Created on 14 May 2021, over 3 years ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

As stated on Migrate commands are now part of Drush core, since Drush 10.4.0, migrate commands are been semi-duplicated in drush core and migrate tools.

Steps to reproduce

N.A.

Proposed resolution

Mainly re-build extra functionality on top of drush core commands. As stated on gitlab, they are highly similar.

For example: Drush core defines the migrate:status, migrate:import, and migrate:rollback commands. Alter these commands to support the --group option.

Although this issue is tagged for version 8.x-5.x, the plan is that the code here will start the 6.0.x branch.

The remainder of this section gives details for each command.

migrate:fields-source (mfs)

Removed from migrate_tools.

migrate:messages (mmsg)

Removed from migrate_tools.

  • idlist support was added to drush core at https://github.com/drush-ops/drush/pull/4728
  • The csv option is already marked as deprecated, so it fits with not adding it again in favor of drush --format=csv.
  • idlist-delimiter support is dropped, now the delimiter is always ":".

migrate:reset-status (mrs)

Removed from migrate_tools.

migrate:status (ms)

Re-written on top of drush migrate commands.

Add the group field using @hook init.

Add the group option using @hook alter.

migrate:stop (mst)

Removed from migrate_tools.

migrate:tree

Command only lives on migrate_tools, no action was needed.

migrate:import (mim)

Add compatibility layer for the skip-progress-bar option, equivalent to no-progress on drush core equivalent. Deprecate skip-progress-bar.

Rewritten via the replace-command consolidation hook, using the migrate_tools version only when the group option is passed.

migrate:rollback (mr)

Add compatibility layer for the skip-progress-bar option, which becomes no-progress on drush core equivalent. Deprecate skip-progress-bar.

Rewritten via the replace-command consolidation hook, using the migrate_tools version only when the group option is passed.

Others

Some other changes tangentially relevant in drush core.

Remaining tasks

In addition to the specific tasks listed here, we may want to re-implement the group option if Provide a way to alter the list of migration IDs in migrate commands is added to Drush core.

migrate:status (ms)

  • Caveat: Long-term we may want to introduce a hook or use one available to pre-filter the set of migrations instead of filtering out the set produced by drush core, assuming it is possible also for the case of tags option which may anyway need a re-walk over migrations. See Provide a way to alter the list of migration IDs in migrate commands.
  • TODO Likely take the same approach than on mim and mr.
  • FIXME Implement continue-on-failure on drush core.

migrate:import (mim)

  • Add support for the continue-on-failure option, ideally on drush core. @claudiu.cristea suggested it can be welcomed there at https://gitlab.com/drupalspoons/migrate_tools/-/issues/118#note_552177518.
  • Add compatibility layer for the sync option, which should become the drush core delete option.
  • Add support on drush core for the tag option to receive multiple values.

migrate:rollback (mr)

  • Add support for the continue-on-failure option, ideally on drush core. See mim equivalent above.

User interface changes

CLI is changing a bit, but the target is that it should not really be noticeable for and end user.

API changes

N.A.

Data model changes

N.A.

πŸ“Œ Task
Status

Needs work

Version

6.0

Component

Code

Created by

πŸ‡΅πŸ‡ͺPeru marvil07

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    This is still a major source of confusion and frustration. And if there need to be issues in the Drush queue to restore what's needed, we should be linking to them from here. (And vice versa, so maybe we can get some effort/flexibility from the Drush side.)

  • πŸ‡ΊπŸ‡ΈUnited States mikelutz Michigan, USA

    There is nothing to restore in the drush queue.. The drush commands in drush core operate on drupal core's migrate system. The overridden versions in migrate_plus add features specific to contrib. This issue is about refactoring the way that migrate_plus overrides the commands in drush core to minimize code duplication, but it has nothing to do with drush core, and it is only a code refactoring issue, it won't affect any functionality.

Production build 0.71.5 2024