1

I'm migrating from an SQL source in a D8 commerce site. Presently, I'm working on product and inventory data. I have one migration for product variations, one for products, and then 6 additional migrations for inventory tables all in a single migration group. (Inventory data migrations are dependent on the product/variation migrations.) Everything works properly when I run the migrations individually. However, I have a strange problem if I use this command:

drush migrate-import --group=my_inventory_group --execute-dependencies

The migration runs fully and reports that everything is ok--no error messages. I get all the inventory data, products, and variations, but the table commerce_product__variations (relationship data from products to their relations) gets only a single record added (instead of the 1510 records it should have.) That record references the first product item in my source data and one of its variations.

I've found that what does work for me is to execute the product and variation migrations individually and then the rest of the group, like this:

drush migrate-import my_variation_migration
drush migrate-import my_product_migration  
drush migrate-import --group=my_inventory_group --execute-dependencies

Since I have this workaround, it's not a huge issue. But I'm curious as to why I can't execute the migration for the entire migration group with the single command. I'm wondering whether I'm missing something related to the structure of the product/variation entities -- the rest of the migration is all for custom entities.

1

Perhaps https://www.drupal.org/node/2830357 comes into play here? Apart from that, the usual use of --execute-dependencies is to migrate a single migration making sure any migrations it depends on have been executed, the group scenario hasn't been tested so there may be some broken assumption in the code.

  • Thanks for the information. I tried to organize my groups so that I don't have any cross-group dependencies, so that isn't my problem. But it's good to know that --execute-dependencies is intended for only single migrations. I can work with that now that I know. – user72086 Jul 12 '17 at 18:08

Your Answer

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