The migrate_upgrade module's --configure-only option allows you to generate migration configuration entities based on the core migration plugins (using them as templates), prefixing them for uniqueness and rewriting references (migration process plugins, migration_dependencies, ...) appropriately. Working on #2455469: Port WordPress Migrate to Drupal 8, the same need arises - the module provides migration plugins, which the UI configures according to user-provided selections and generates configuration entities based on those plugins. It would be nice to have a common API both (as well as similar scenarios) can rely upon.

  1. Given a migration plugin ID, create a migration configuration entity with an ID derived from the original (the most common scenario would involve prefixing it, but should we support other transmogrifications?)
  2. Rewrite references to migrations (notably in migration process plugins and migration_dependencies) to reflect the ID rewriting.
  3. Allow general modifications to migration configuration - it'd be nice to permit this during the process, before saving the configuration entity, but clients can always do modification after the fact, so this is optional.

Comments

mikeryan created an issue. See original summary.

mikeryan’s picture

Status: Active » Fixed

Kept it simple - just added Migration::createEntityFromPlugin($plugin_id, $new_plugin_id), no attempt at rewriting references (which is harder to do in a general way than I first thought.

Status: Fixed » Closed (fixed)

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