migrate_plus.migration.d7_uc_roles_license.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Migrates role purchase licenses from UC Roles module.
  2. # This is incomplete and is specificaly created for materio.
  3. id: d7_uc_roles_license
  4. label: License from D7 Ubercart Roles.
  5. migration_group: d7_materio
  6. migration_tags:
  7. - Drupal 7
  8. - Ubercart
  9. - Materio
  10. source:
  11. plugin: d7_uc_license_role
  12. destination:
  13. plugin: entity:commerce_license
  14. destination_module: commerce_license
  15. process:
  16. type:
  17. # Migrate into the role license type.
  18. plugin: default_value
  19. default_value: role
  20. uid:
  21. -
  22. plugin: skip_on_empty
  23. method: row
  24. source: uid
  25. -
  26. plugin: migration_lookup
  27. migration: d7_users
  28. # source: uid
  29. no_stub: true
  30. # state:
  31. # plugin: default_value
  32. # default_value: active
  33. state: state
  34. created: created
  35. granted: created
  36. renewed: renewed
  37. changed: renewed
  38. license_role:
  39. plugin: static_map
  40. source: rid
  41. map:
  42. 6: adherent
  43. 10: student
  44. expiration_type:
  45. # This assumes Commerce Recurring is used with licenses.
  46. plugin: default_value
  47. default_value:
  48. target_plugin_id: rolling_interval
  49. target_plugin_configuration:
  50. interval:
  51. interval: 1
  52. period: year
  53. # array (
  54. # 'interval' => array (
  55. # 'interval' => '6',
  56. # 'period' => 'month',
  57. # ),
  58. # )
  59. # expires:
  60. # # This assumes Commerce Recurring is used with licenses.
  61. # plugin: default_value
  62. # default_value: 0
  63. expires: expiration
  64. # product_variation:
  65. # plugin: migration_lookup
  66. # migration: # your product variation migration
  67. # source: nid
  68. product_variation: product_variation_id
  69. # plugin: static_map
  70. # source: rid
  71. # map:
  72. # 6: 2 # web annual
  73. # 10: 7 # web annual
  74. migration_dependencies:
  75. required:
  76. - d7_users
  77. optional: {}
  78. dependencies:
  79. enforced:
  80. module:
  81. - commerce_product
  82. - commerce_license