Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. ID,Name,Last name,Birthday,Email,Photo,Languages
  2. 1,Sofia,Roque,1999-12-05,sofiaroque@gmail.com,P1.jpg,Spanish
  3. 2,Funny,Pilares,1997-11-10,funnypiller@yahoo.com,P2.jpg,Englsih
  4. 3, Thelma,Meller,1994-02-07,thelmakira@gmail.com,P3.jpg,SPanish
  5.  
  6. dependencies:
  7. module:
  8. - migrate_source_csv
  9. id: profile
  10. migration_tags:
  11. - CSV
  12. migration_group: null
  13. label: Profile
  14. source:
  15. plugin: csv
  16. path: modules/custom/custom_migrate/assets/csv/profile.csv
  17. header_row_count: 1
  18. keys:
  19. - id
  20. column_names:
  21. -
  22. id: ID
  23. -
  24. first_name: 'First Name'
  25. -
  26. last_name: 'Last Name'
  27. -
  28. birthday: Birthday
  29. -
  30. email: Email
  31. -
  32. photo: Photo
  33. process:
  34. type:
  35. plugin: default_value
  36. default_value: profile
  37. title:
  38. plugin: concat
  39. source:
  40. - first_name
  41. - last_name
  42. delimiter: ' '
  43. field_first_name: first_name
  44. field_last_name: last_name
  45. field_birthday: birthday
  46. field_email: email
  47. field_language:
  48. plugin: entity_generate
  49. source: languages
  50. field_photo:
  51. -
  52. plugin: explode
  53. source: photo
  54. delimiter: ;
  55. -
  56. plugin: callback
  57. callable: trim
  58. -
  59. plugin: callback
  60. callable: strtoupper
  61. -
  62. plugin: migration
  63. migration: photo
  64. no_stub: true
  65. 'field_photo/target_id':
  66. plugin: migration
  67. plugin: file_import
  68. migration: photo
  69. source: Photo
  70. destination:
  71. plugin: 'entity:node'
  72. migration_dependencies:
  73. optional:
  74. - photo
  75.  
  76. dependencies:
  77. module:
  78. - file
  79. id: photo
  80. migration_tags:
  81. - CSV
  82. migration_group: null
  83. label: Photos
  84. source:
  85. constants:
  86. source_base_path: modules/custom/custom_migrate/assets/photos
  87. uri_file: 'public://photos'
  88. plugin: csv
  89. track_changes: true
  90. path: modules/custom/custom_migrate/assets/csv/profile.csv
  91. header_row_count: 1
  92. keys:
  93. - name
  94. column_names:
  95. 5:
  96. name: Photo
  97.  
  98. process:
  99. source_full_path:
  100. -
  101. plugin: concat
  102. delimiter: /
  103. source:
  104. - constants/source_base_path
  105. - name
  106. -
  107. plugin: urlencode
  108. uri_file:
  109. -
  110. plugin: concat
  111. delimiter: /
  112. source:
  113. - constants/uri_file
  114. - name
  115. -
  116. plugin: urlencode
  117. filename: name
  118. uri:
  119. plugin: file_copy
  120. source:
  121. - '@source_full_path'
  122. - '@uri_file'
  123. destination:
  124. plugin: 'entity:file'
  125. migration_dependencies:
  126. required: { }
  127. optional: { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement