Looking ahead to Migrate 2.6, the main theme of that release will be developing a framework for building user-friendly UIs for migration. This will be a significant step forward towards addressing #1123538: UI for defining migrations, at least for particular scenarios that implement this framework. Work has already begun - the adventurously curious can see the current state by checking out the wizard_api branches of Migrate and migrate_d2d.

The idea is to support a wizard approach to the UI - leading the user through a series of steps to choose what to migrate and how to map it to the destination Drupal environment, ultimately registering a set of migrations to perform the actual import. The existing migrate_ui dashboard would then be used to run the import, rollback, etc. I expect we'll want to do some redesign here - the existing UI was designed with developers in mind, I think we'll want to simplify it some for the use of non-technical folks. In particular, we'll want to do a better job of leveraging groups - finally implementing #1350284: Display Migration's group on UI for one thing.

Modules implementing migrations from particular sources (Drupal, WordPress, Ning, etc.) would extend the new MigrateUIWizard class, providing forms and validation functions for each step. The extended class will be registered via the 'wizard classes' attribute in hook_migrate_api(), and the steps supported registered in the class constructor:

  public function __construct() {
    parent::__construct();
    $this->addStep(t('Overview'), 'overviewForm');
    $this->addStep(t('Credentials'), 'sourceDataForm');
    $this->addStep(t('Users'), 'userForm');
    $this->addStep(t('Taxonomy'), 'taxonomyForm');
    $this->addStep(t('Content Types'), 'contentTypeForm');
    $this->addStep(t('Review'), 'reviewForm');
  }

The form methods registered here would build and return a form array in the usual way - each one is expected to also have a validation function (overviewFormValidate(), sourceDataFormValidate(), etc.) which will save any data needed by subsequent steps, and of course validate that the user input makes sense. The final Review form will present the choices made by the user, and on Submit register migrations reflecting those choices, redirecting to the Dashboard.

Feedback is, of course, welcome.

Comments

mikeryan’s picture

mikeryan’s picture

Issue tags: +Migrate 2.6

Tagging for 2.6.

ayalon’s picture

Could you provide a hint how to download this "wizard_api branch"? Its's not in the dev version of the modul right?

mikeryan’s picture

When Migrate 2.5 was released, the wizard_api branch was merged back into 7.x-2.x, so this work is now available in the -dev releases of Migrate and WordPress Migrate (migrate_d2d hasn't had its initial release yet, so it still has the separate wizard_api branch).

mikeryan’s picture

I've gone back now - I had expected to stabilize the work for the next version more quickly, but have been busy on other stuff, I decided it would be better to keep 7.x-2.x-dev relatively stable for now. The wizard work is now back to the wizard_api branch.

mikeryan’s picture

I should clarify - I've reverted 7.x-2.x back to where it was for the 7.x-2.5 release. All changes since then are now in the wizard_api branch and will be merged back to 7.x-2.x when I feel its stable enough.

naught101’s picture

Nice. Kind of wondering whether it might not make more sense to put the wizard in it's own module?

mikeryan’s picture

The Migrate side of this just provides underlying services, it only has a visible effect in the presence of a module implementing the API, so I think it's fine to have it in migrate_ui.

mikeryan’s picture

Component: migrate_ui » Documentation

I've finally merged this work back into the 7.x-2.x branch. Any further enhancements/bug fixes should go into separate issues. The one thing left to do before closing the main issue here is to document the wizard API.

mikeryan’s picture

Component: Documentation » migrate_ui
Status: Active » Fixed

Actually, there are a number of other changes to document for Migrate 2.6, created a separate documentation issue: #1965854: Update documentation for Migrate 2.6.

Status: Fixed » Closed (fixed)

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

JeremyFrench’s picture

I have to say I was thinking along the lines of naught101.

You have built a very nice wizard framework for Drupal. While I will make good use of it for Migrations, I am sure that there will be applications for a wizard in other modules. Probably too late to change it now.