3

I am trying to do a POC using Migrate, Migrate Plus, and Migrate Tools to define migrations and having trouble getting my migration to register and appear in the list of migrations for the migration group I created (in the UI).

In my yaml file, I put in the basics just to try and get it to appear in the UI:

id: remote_entity
label: TESTING
migration_group: mygroup

I named the file remote_entity.yml in a folder called migrations (I got this from the example in the Migrate Plus) module. Yet, it does not appear.

I see other modules have theirs in the config/install directory with a naming pattern assigned. Where is this file supposed to really be? What should it be named to get picked up? If it is in the config/install directory, do I have to uninstall/install the module numerous times as I iterate over a POC and make changes to the migration definition?

  • You have to prefix name like migrate_plus.migration.id_name.yml – MrD Feb 26 at 16:07
  • 1
    Where? In an install folder? In a migrations folder? Having trouble finding docs on this. – Kevin Feb 26 at 16:08
  • You can follow structure folder, file name of module migrate_example**(sub module of module **migrate_plus). Group migrate have syntax name migrate_plus.migration_group.group_id.yml, Migrate have syntax name **migrate_plus.migration.migrate_id.yml. So you need to create migrate group firstly, and create migrate and reinstall module. – MrD Feb 26 at 16:18
2

Where is this file supposed to really be?

It's config, so config/install is fine

What should it be named to get picked up?

Like other config it's module_name.type.machine_name.yml, so (e.g.) migrate_plus.migration.id.yml

do I have to uninstall/install the module numerous times as I iterate over a POC and make changes to the migration definition?

No, just like a normal config import you can do it partially:

drush cim --partial --source=/path/to/your/module/config/install

I did exactly what you did when I first played with Migrate Plus - tried to put the config in a migrations folder, like the example, but it didn't work for me either.

As migrations are config, this does make sense looking back - otherwise Migrate Plus would need to do something non-standard when discovering/importing migration configurations.

  • Let me give this a shot. – Kevin Feb 26 at 16:46
  • So the file(s) are recognized now, but the cim partial command does not seem to work for changing a yaml file here. – Kevin Feb 26 at 17:15
  • Uninstalling also does not delete config objects, so re-installing does not overwrite with changes. – Kevin Feb 26 at 17:23
  • @Kevin I just finished a project which was heavy on migration - I must’ve used the partial flag 100+ times a day, it never failed to work for me. IIRC I had trouble getting it to work properly on Acquia though – Clive Feb 26 at 17:24
  • Oh that one’s easy - add the module as a dependency of each migration config. Then they get nuked when the module is uninstalled – Clive Feb 26 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.