uc6_order.yml in Commerce Migrate 3.0.x
Same filename and directory in other branches
modules/ubercart/migrations/uc6_order.yml
File
modules/ubercart/migrations/uc6_order.ymlView source
- # Ubercart 6 Order Migration
- id: uc6_order
- label: Migrate orders from Ubercart
- migration_tags:
- - Drupal 6
- - Ubercart
- - Content
- source:
- plugin: uc_order
- constants:
- store_id: 1
- process:
- # If you are using this file to build a custom migration consider removing
- # the order_id field to allow incremental migrations.
- order_id: order_id
- order_number: order_id
- order_items:
- plugin: migration_lookup
- migration: uc6_order_product
- source: order_item_ids
- uid: uid
- type:
- plugin: default_value
- default_value: default
- store_id: 'constants/store_id'
- mail: primary_email
- # Get the profile id and revision id for this order.
- billing_profile_data:
- -
- plugin: migration_lookup
- migration: uc6_profile_billing
- source: order_id
- billing_profile/target_id:
- -
- plugin: skip_on_empty
- method: process
- source: '@billing_profile_data'
- -
- plugin: extract
- index: [0]
- billing_profile/target_revision_id:
- -
- plugin: skip_on_empty
- method: process
- source: '@billing_profile_data'
- -
- plugin: extract
- index: [1]
- state:
- plugin: static_map
- source: order_status
- default_value: draft
- map:
- # These are the equivalent order states I was able to gather from the
- # documentation.
- in_checkout: draft
- pending: validation
- processing: draft
- payment_received: completed
- completed: completed
- canceled: canceled
- ip_address: host
- data/refresh_state:
- plugin: static_map
- source: order_status
- bypass: true
- map:
- # Do not refresh the order during migration of in_checkout orders.
- in_checkout: refresh_state
- created: created
- changed: modified
- # Set the placed time only if not draft or cancelled.
- placed:
- -
- plugin: skip_on_value
- method: process
- source: '@state'
- value:
- - draft
- - cancelled
- -
- plugin: get
- source: modified
- # Set the completed time only if completed
- completed:
- -
- plugin: skip_on_value
- method: process
- not_equals: true
- source: '@state'
- value: completed
- -
- plugin: get
- source: modified
- adjustments:
- plugin: commerce_adjustments
- source: adjustments
- field_order_comments: order_comments
- field_order_admin_comments: order_admin_comments
- field_order_logs:
- -
- plugin: sub_process
- source: order_logs
- process:
- value:
- -
- plugin: callback
- callable: strip_tags
- source: value
- destination:
- plugin: 'entity:commerce_order'
- destination_module: commerce_order
- migration_dependencies:
- required:
- - uc6_store
- - uc6_profile_billing
- - uc6_order_product
- - uc_order_field_instance