Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID,Name,Last name,Birthday,Email,Photo,Languages
- 1,Sofia,Roque,1999-12-05,sofiaroque@gmail.com,P1.jpg,Spanish
- 2,Funny,Pilares,1997-11-10,funnypiller@yahoo.com,P2.jpg,Englsih
- 3, Thelma,Meller,1994-02-07,thelmakira@gmail.com,P3.jpg,SPanish
- dependencies:
- module:
- - migrate_source_csv
- id: profile
- migration_tags:
- - CSV
- migration_group: null
- label: Profile
- source:
- plugin: csv
- path: modules/custom/custom_migrate/assets/csv/profile.csv
- header_row_count: 1
- keys:
- - id
- column_names:
- -
- id: ID
- -
- first_name: 'First Name'
- -
- last_name: 'Last Name'
- -
- birthday: Birthday
- -
- email: Email
- -
- photo: Photo
- process:
- type:
- plugin: default_value
- default_value: profile
- title:
- plugin: concat
- source:
- - first_name
- - last_name
- delimiter: ' '
- field_first_name: first_name
- field_last_name: last_name
- field_birthday: birthday
- field_email: email
- field_language:
- plugin: entity_generate
- source: languages
- field_photo:
- -
- plugin: explode
- source: photo
- delimiter: ;
- -
- plugin: callback
- callable: trim
- -
- plugin: callback
- callable: strtoupper
- -
- plugin: migration
- migration: photo
- no_stub: true
- 'field_photo/target_id':
- plugin: migration
- plugin: file_import
- migration: photo
- source: Photo
- destination:
- plugin: 'entity:node'
- migration_dependencies:
- optional:
- - photo
- dependencies:
- module:
- - file
- id: photo
- migration_tags:
- - CSV
- migration_group: null
- label: Photos
- source:
- constants:
- source_base_path: modules/custom/custom_migrate/assets/photos
- uri_file: 'public://photos'
- plugin: csv
- track_changes: true
- path: modules/custom/custom_migrate/assets/csv/profile.csv
- header_row_count: 1
- keys:
- - name
- column_names:
- 5:
- name: Photo
- process:
- source_full_path:
- -
- plugin: concat
- delimiter: /
- source:
- - constants/source_base_path
- - name
- -
- plugin: urlencode
- uri_file:
- -
- plugin: concat
- delimiter: /
- source:
- - constants/uri_file
- - name
- -
- plugin: urlencode
- filename: name
- uri:
- plugin: file_copy
- source:
- - '@source_full_path'
- - '@uri_file'
- destination:
- plugin: 'entity:file'
- migration_dependencies:
- required: { }
- optional: { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement