Now that migrate_plus is implementing migration configuration entites for D8.1.x (#2701277: Provide a means of explicitly registering migrations), we should be able to do configure-only again. The option should create configuration entities for each migration instead of running them, leaving them able to be managed by migrate_tools.

CommentFileSizeAuthor
#2 restore_configure_only-2704721-2.patch6.97 KBmikeryan

Comments

mikeryan created an issue. See original summary.

mikeryan’s picture

Status: Active » Needs review
StatusFileSize
new6.97 KB

Here we go... A suggested workflow for using this to do custom Drupal-to-Drupal migrations:

  1. Install a fresh empty D8 site, enabling all modules for which you wish to migrate data.
  2. Run the drush migrate-upgrade command with the --configure-only option. This generates migration configuration entities in the D8 database (config table).
  3. Create a custom module containing only a .info.yml file (with dependencies on migrate_plus and migrate_drupal) and a config/install directory.
  4. Export your site configuration, e.g. drush cex --destination=/tmp/export
  5. Copy the migration configuration that was generated by migrate-upgrade - be sure *not* to copy the default group configuration, which is defined by migrate_plus:
    cp /tmp/export/migrate_plus.migration.* /tmp/export/migrate_plus.migration_group.migrate_*.yml migrate_custom/config/install/
  6. Look at that migrate_plus.migration_group.* file - you'll see your database configuration captured there. In most cases, what you'll want to do is define your database connection in settings.php with those credentials under the key that is configured there - you won't want to commit the credentials to your git repo.
  7. Edit the generated .yml files to reflect your custom migration path.
  8. Reinstall D8, enable your custom module and migrate_tools, and proceed to work with your Drupal migrations as you would with any custom migration. Hint: you'll probably want config_devel so you can edit .yml files in config/install and immediately test your changes.
willwh’s picture

Status: Needs review » Reviewed & tested by the community

Mike this is just great :)

I can confirm this works nicely, having just finished up following your instructions, after applying the patch. Awesome!

  • mikeryan committed 6a7b944 on 8.x-2.x
    Issue #2704721 by mikeryan: Restore configure-only option
    
mikeryan’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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