We recently upgraded from Aegir 7.x-3.11 to Aegir 7.x-3.151 on an internal CI server and found that we can no longer run Migrate API Drush commands on sites maintained by Aegir. I'm not sure what changed in Aegir Hostmaster, but it appears related to the blacklist in /var/aegir/.drush/drushrc.php:

# A list of modules to be excluded because the hosting feature is not enabled.
$options['exclude'] = array (
  0 => 'logs_git',
  1 => 'logs',
// ...
  15 => 'migrate',
// ...
  37 => 'dns',
  38 => 'civicrm_cron',
  39 => 'civicrm',
);

If I remove migrate from that list and clear the Drush cache, I can once again see Migrate Drush commands:

All commands in migrate: (migrate)
 migrate-analyze       Analyze the source fields for a migration.
 (maz)
 migrate-audit (ma)    View information on problems in a migration.
 migrate-auto-registe  Register any newly defined migration classes
 r (mar)
 migrate-deregister    Remove all tracking of a migration
 (mdreg)
 migrate-fields-desti  List the fields available for mapping in a destination.
 nation (mfd)
 migrate-fields-sourc  List the fields available for mapping from a source.
 e (mfs)
 migrate-import (mi)   Perform one or more migration processes
 migrate-mappings      View information on all field mappings in a migration.
 (mm)
 migrate-messages      View any messages associated with a migration.
 (mmsg)
 migrate-register      Register or reregister any statically defined migrations
 (mreg)
 migrate-reset-status  Reset a active migration's status to idle
 (mrs)
 migrate-rollback      Roll back the destination objects from a given migration
 (mr)
 migrate-status (ms)   List all migrations with current status.
 migrate-stop (mst)    Stop an active migration operation
 migrate-wipe (mw)     Delete all nodes from specified content types.

It appears that this is a regression. Is there any legitimate reason why the Migrate API Drush commands should be blocked? Or is this just an unfortunate side-effect of their being a component of Aegir that is also called Migrate? I did not see Migrate API included in the 7.x release of Hostmaster itself.

Comments

GuyPaddock created an issue. See original summary.

guypaddock’s picture

Issue summary: View changes
guypaddock’s picture

Title: Cannot use Migrate API Drush commands with Aegir-managed sites » Name clash -- Migrate API Drush commands do not work on Aegir-managed sites when "Site migration" is disabled

I figured out why we are seeing this -- "Site migration" was enabled in our 7.x-3.11 install of Hostmaster, but it was not enabled in the 7.x-3.151 install of Hostmaster. If we enable that module, the auto-generated copy of drushrc.php does not blacklist the migrate module. So, that's a workaround.

The real issue is that there is a name clash here -- both Hostmaster and Migrate API define a Drush command file for migrate.

guypaddock’s picture

Title: Name clash -- Migrate API Drush commands do not work on Aegir-managed sites when "Site migration" is disabled » Name clash: Migrate API Drush commands do not work on Aegir-managed sites when "Site migration" is disabled
helmo’s picture

Status: Active » Needs review

Aegir has provision-migrate and hostmaster-migrate as commands but what's clashing here is the hosting feature from hosting/migrate/hosting.feature.migrate.inc

Since the module is called hosting_migrate it might be safe to change that feature name to sitemigrate. (The hosting_) prefix is handled elsewhere in the code so changing it to hosting_migrate would break things.

This commit might just be all we need.

helmo’s picture

Status: Needs review » Fixed

I've merged this to 7.x-3.x to test it further with the upcoming #2969160: [meta] 3.16 release (bugfix/patches)

Lets re-open if we notice any side effects.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

guypaddock’s picture

Many thanks for the fix!