You are here

magento2_image.yml in Commerce Migrate 8.2

modules/magento/migrations/magento2_image.yml

File

modules/magento/migrations/magento2_image.yml
View source
  1. id: magento2_image
  2. label: Migrate Magento 2 images
  3. migration_group: commerce_migrate_magento2
  4. migration_tags:
  5. - Magento 2
  6. - Content
  7. source:
  8. # Uses a custom source plugin to yield the top level category.
  9. plugin: magento2_image_csv
  10. # Change the path and filename to match your source CSV file.
  11. path: 'public://import/magento2-catalog_product_20180326_013553_test.csv'
  12. # Change the enclosure character to suit your source CVS file.
  13. enclosure: "\""
  14. # Change the number of header rows to suit your source CVS file.
  15. header_offset: 0
  16. # The key field is the top level category determined from the 'categories'
  17. # column. The source plugin determines the vocabulary name and adds it to
  18. # the source row indexed by 'vocabulary'.
  19. ids: [sku, image]
  20. fields:
  21. - name: sku
  22. label: SKU
  23. - name: store_view_code
  24. label: Store view code
  25. - name: attribute_set_code
  26. label: Attribute set code
  27. - name: product_type
  28. label: Product type
  29. - name: categories
  30. label: Categories
  31. - name: product_websites
  32. label: Product websites
  33. - name: name
  34. label: Name
  35. - name: description
  36. label: Description
  37. - name: short_description
  38. label: Short description
  39. - name: weight
  40. label: Weight
  41. - name: product_online
  42. label: product_online
  43. - name: tax_class_name
  44. label: tax_class_name
  45. - name: visibility
  46. label: visibility
  47. - name: price
  48. label: Price
  49. - name: special_price
  50. label: Special price
  51. - name: special_price_from_date
  52. label: Special price from date
  53. - name: special_price_to_date
  54. label: Special price to date
  55. - name: url_key
  56. label: Url key
  57. - name: meta_title
  58. label: Meta title
  59. - name: meta_keywords
  60. label: Meta keywords
  61. - name: meta_description
  62. label: Meta description
  63. - name: base_image
  64. label: Base image
  65. - name: base_image_label
  66. label: Base image label
  67. - name: small_image
  68. label: Small image
  69. - name: small_image_label
  70. label: Small image label
  71. - name: thumbnail_image
  72. label: Thumbnail image
  73. - name: thumbnail_image_label
  74. label: Thumbnail image label
  75. - name: swatch_image
  76. label: Swatch image
  77. - name: swatch_image_label
  78. label: Swatch image label
  79. - name: created_at
  80. label: Created at
  81. - name: updated_at
  82. label: Updated at
  83. - name: new_from_date
  84. label: New from date
  85. - name: new_to_date
  86. label: New to date
  87. - name: display_product_options_in
  88. label: display product options in
  89. - name: map_price
  90. label: Map price
  91. - name: msrp_price
  92. label: MSRP price
  93. - name: msrp_price
  94. label: msrp_price
  95. - name: map_enabled
  96. label: map_enabled
  97. - name: gift_message_available
  98. label: gift_message_available
  99. - name: custom_design
  100. label: custom_design
  101. - name: custom_design_from
  102. label: custom_design_from
  103. - name: custom_design_to
  104. label: custom_design_to
  105. - name: custom_layout_update
  106. label: custom_layout_update
  107. - name: page_layout
  108. label: page_layout
  109. - name: product_options_container
  110. label: product_options_container
  111. - name: msrp_display_actual_price_type
  112. label: msrp_display_actual_price_type
  113. - name: country_of_manufacture
  114. label: country_of_manufacture
  115. - name: additional_attributes
  116. label: additional_attributes
  117. - name: qty
  118. label: qty
  119. - name: out_of_stock_qty
  120. label: out_of_stock_qty
  121. - name: use_config_min_qty
  122. label: use_config_min_qty
  123. - name: is_qty_decimal
  124. label: is_qty_decimal
  125. - name: allow_backorders
  126. label: allow_backorders
  127. - name: use_config_backorders
  128. label: use_config_backorders
  129. - name: min_cart_qty
  130. label: min_cart_qty
  131. - name: use_config_min_sale_qty
  132. label: use_config_min_sale_qty
  133. - name: max_cart_qty
  134. label: max_cart_qty
  135. - name: use_config_max_sale_qty
  136. label: use_config_max_sale_qty
  137. - name: is_in_stock
  138. label: is_in_stock
  139. - name: notify_on_stock_below
  140. label: notify_on_stock_below
  141. - name: use_config_notify_stock_qty
  142. label: use_config_notify_stock_qty
  143. - name: manage_stock
  144. label: manage_stock
  145. - name: use_config_manage_stock
  146. label: use_config_manage_stock
  147. - name: use_config_qty_increments
  148. label: use_config_qty_increments
  149. - name: qty_increments
  150. label: qty_increments
  151. - name: use_config_enable_qty_inc
  152. label: use_config_enable_qty_inc
  153. - name: enable_qty_increments
  154. label: enable_qty_increments
  155. - name: is_decimal_divided
  156. label: is_decimal_divided
  157. - name: website_id
  158. label: website_id
  159. - name: related_skus
  160. label: related_skus
  161. - name: related_position
  162. label: related_position
  163. - name: crosssell_skus
  164. label: crosssell_skus
  165. - name: crosssell_position
  166. label: crosssell_position
  167. - name: upsell_skus
  168. label: upsell_skus
  169. - name: upsell_position
  170. label: upsell_position
  171. - name: additional_images
  172. label: additional_images
  173. - name: additional_image_labels
  174. label: additional_image_labels
  175. # Set constants for values not in the source data.
  176. constants:
  177. base_path: public://import/images/catalog/product
  178. process:
  179. sku:
  180. plugin: skip_on_empty
  181. method: row
  182. source: sku
  183. filename:
  184. -
  185. plugin: skip_on_empty
  186. method: row
  187. source: image
  188. -
  189. plugin: callback
  190. callable: basename
  191. dir:
  192. plugin: callback
  193. callable: dirname
  194. source: image
  195. # Path to the source file.
  196. full_path:
  197. -
  198. plugin: concat
  199. source:
  200. - 'constants/base_path'
  201. - image
  202. -
  203. plugin: urlencode
  204. # Copy the files from the source to the destination. Here the source files
  205. # have been moved to the destination by some other, probably faster, means and
  206. # the configuration property 'file_exists' is set to 'use existing' so that no
  207. # copy action takes place. This will improve performance.
  208. uri:
  209. plugin: file_copy
  210. file_exists: use existing
  211. source:
  212. - '@full_path'
  213. - '@full_path'
  214. # Assign a uid to the file, default to 1.
  215. uid:
  216. plugin: default_value
  217. source: image_uid
  218. default_value: 1
  219. status:
  220. plugin: default_value
  221. default_value: 1
  222. destination:
  223. plugin: entity:file