Workflow versioning (#3604588) shipped a "Migrate instances here" form to move a workflow's running instances onto a target version. This proposes a Drush command that does the same thing from the command line, for the cases a form does not cover.

Why

  • Scale: the form migrates one workflow interactively; a deploy might need to migrate many workflows, or thousands of instances, unattended.
  • Deploy automation: in manual versioning mode the natural sequence is publish, then migrate running instances to the new version. That belongs in a deploy script alongside drush updb / drush cr, not a manual click.
  • Headless sites: Orchestra can run as a headless engine with no orchestra_ui, where Drush is the only operator surface.
  • Dry run: an operator wants "this will move N instances and node X needs a mapping" before touching production.

Proposed command

drush orchestra:migrate-versions {workflow_id} [--to=VERSION] [--map=old:new,old2:new2] [--dry-run]
  • workflow_id: the workflow whose running instances to migrate.
  • --to: target version (revision) id; defaults to the current published version.
  • --map: node remappings for renamed or removed nodes (old_node:new_node), the CLI form of the migrate form's mapping selects.
  • --dry-run: report how many instances would migrate and which live nodes still need a mapping, without changing anything.

Implementation

A thin wrapper over the existing WorkflowVersionManagerInterface, which already exposes everything needed: currentVersion()/publishedVersion(), versions(), runningInstanceCount() and migrate(). The command parses --map into the node-map array, resolves --to (defaulting to the published version), and calls migrate(); it surfaces the same validation error when a live node has no mapping in the target. --dry-run uses runningInstanceCount() and a survey of live nodes missing from the target, the same survey the form does, without calling migrate().

Note: the module has no Drush integration yet, so this adds the first command (a drush.services.yml / commands class, or a #[CLI\Command] attribute class). No engine or manager change is required.

Related

  • #3604588: workflow definition versioning (the migrate API and form this wraps).

Issue fork orchestra-3605111

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

  • mably committed a25a5a50 on 1.x
    feat: #3605111 Drush command to migrate running instances between...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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