Quantcast
Channel: Active questions tagged feeds - Drupal Answers
Viewing all articles
Browse latest Browse all 199

How to prevent creation of new commerce products in a migration intended only to update a specific field?

$
0
0

Many months ago, I wrote a migration for Commerce products from Drupal 7 to Drupal 10 and successfully migrated those products. However, now I need to migrate the GUIDs from the feeds_item table in Drupal 7 into the "Feeds item" field of the product in Drupal 10. I implemented the following migration:

id: commerce_product_feeds_item_guids_migrationmigration_group: migrate_drupal_7label: 'Commerce Product Feeds item GUIDs migration'source:  plugin: drupal_seven_migration_product_feeds_item_guid  product_type: productsprocess:  feeds_item/target_id:    plugin: default_value    default_value: '3'    strict: 0  feeds_item/guid: guiddestination:  plugin: 'entity:commerce_product'  destination_module: commerce_product  default_bundle: product_line#  update fields

The issue:
When I ran the following command:
drush migrate:import commerce_product_feeds_item_guids_migration --update
instead of updating the "Feeds item" field in the existing product, a new product was created.

Someone suggested that it might be possible to specify something in the destination section so that the migration simply updates the necessary fields of the existing product instead of creating a new one - but they couldn’t recall exactly what needs to be added.

Question:
What exactly should be specified in the destination section? Or how can I fix this issue?


Viewing all articles
Browse latest Browse all 199

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>