You are here

magento2_category.yml in Commerce Migrate 3.1.x

modules/magento/migrations/magento2_category.yml

File

modules/magento/migrations/magento2_category.yml
View source
  1. # Migrate top level category to taxonomy vocabulary.
  2. # This migration uses a source CSV file created using the Magento 2 export
  3. # command, System->Export and selecting Products.
  4. id: magento2_category
  5. label: Migrate Magento 2 category to taxonomy vocabulary.
  6. migration_group: commerce_migrate_magento2
  7. migration_tags:
  8. - Magento 2
  9. - Configuration
  10. source:
  11. # Uses a custom source plugin to yield the top level category.
  12. plugin: magento2_category_csv
  13. # Change the path and filename to match your source CSV file.
  14. path: 'public://import/magento2-catalog_product_20180326_013553.csv'
  15. # Change the enclosure character to suit your source CVS file.
  16. enclosure: "\""
  17. # Change the number of header rows to suit your source CVS file.
  18. header_offset: 0
  19. # The key field is the top level category determined from the 'categories'
  20. # column. The source plugin determines the vocabulary name and adds it to
  21. # the source row indexed by 'vocabulary'.
  22. ids: [vocabulary]
  23. # Set constants for values not in the source data.
  24. constants:
  25. description: NULL
  26. hierarchy: 0
  27. weight: 0
  28. process:
  29. vid:
  30. -
  31. plugin: machine_name
  32. source: vocabulary
  33. -
  34. plugin: skip_on_empty
  35. method: row
  36. -
  37. plugin: substr
  38. start: 0
  39. length: 32
  40. exists:
  41. -
  42. plugin: entity_exists
  43. source: '@vid'
  44. entity_type: taxonomy_vocabulary
  45. -
  46. plugin: callback
  47. callable: is_bool
  48. -
  49. plugin: skip_on_empty
  50. method: row
  51. label: vocabulary
  52. name: vocabulary
  53. description: constants/description
  54. hierarchy: constants/hierarchy
  55. weight: constants/weight
  56. destination:
  57. plugin: entity:taxonomy_vocabulary