0

I have written a migration script that is working but After migrate data I need a method/way to store recent inserted id with some other relevant data in another custom database table.

Can I do with help of any hook or use any plugin. This is my yml file.

id: order_billing_address
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: default
label: 'User profile for billing information'
source:
  plugin: csv
  path: pathtocsv/order_billing_address.csv
  header_row_count: 1
  keys:
    - profile_id
process:
  type:
    plugin: default_value
    default_value: 'customer'
  uid: uid
  profile_id: profile_id
  address/country_code: country
  address/administrative_area: state
  address/locality: locality
  address/dependent_locality: locality
  address/postal_code: postal_code
  address/sorting_code: ''
  address/address_line1: street
  address/address_line2: street2
  address/organization: company_name
  address/given_name: first_name
  address/family_name: last_name
destination:
  plugin: 'entity:profile'
migration_dependencies: {  }
0

In order to do this, I will create a custom module, an event, dispatch it in a hook_ENTITY_TYPE_insert implementation and subscribe to it so that we can insert the data into different custom table.

https://x-team.com/blog/creating-and-subscribing-to-events/

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.