2

I'm trying to create a Migrate group with following code. But it is not detected & listed in admin/structure/migrate. Both migrate plus & Migrate tools modules are installed. I"m trying to create migration from WordPress tables. The module is called migrate_wordpress & migrate group is defined in config/install with the name migrate_wordpress. migrate_group.wordpress.yml

id: wprdpress
label: WordPress Imports
description: Import from WordPress blog
source_type: Custom tables

What is wrong with above Migrate group configurations? What is the correct way to write an migrate group configuration file in Drupal 8?

2 Answers 2

7

I believe that groups are a feature of the migrate_plus module. In order for them to be recognised, the file needs to be named migrate_plus.migration_group.<group_name>.yml. The actual migrations also need to be formatted like this migrate_plus.migration.<migration_name>.yml.

One other issue I see is that your id: wprdpress should be id: wordpress. (Just in case that typo is in your code :) )

The last thing is that migrations are only defined on module install. This means that you have to uninstall and re-install every time. (Or you can implement some drush commands to do it for you. Check out this tutorial.)

3
  • It worked wonderful , I'm able to see Migration groups and actual migrations listed too. Also thanks for the nice tutorial. Commented Dec 22, 2016 at 19:18
  • 1
    Glad it helped! This is all fresh in my brain as I've been working my way through my own D8 migration. Banged my head against the wall for quite a while on this one.
    – lukedekker
    Commented Dec 22, 2016 at 20:02
  • The Devel module has the command drush dre my_module to reinstall a module.
    – mbomb007
    Commented Sep 6, 2022 at 20:31
1

In .yml file we define four major parts for Migration. These are id, source, process and destination. Id is to identify this Migration process Id to identify. Source is defined with the data source. Process define basically the mapping of fields in between destination and source. It seems you are missing process and destination. To define Migration group you can define it like this

migration_group: custom
destination:
    plugin: entity:file

You can refer this Migrate Module as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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