Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save punyaruchal/4b02ef6e04678e5d8b8073d8a61c0eb9 to your computer and use it in GitHub Desktop.
Save punyaruchal/4b02ef6e04678e5d8b8073d8a61c0eb9 to your computer and use it in GitHub Desktop.
dependencies:
module:
- file
id: migrate_csv_articles_images
label: 'Migrate Images for the articles from the csv file'
migration_group: null
source:
constants:
source_base_path: '/Library/WebServer/Documents/drupal/modules/custom/migrate_csv/assets/pictures'
uri_file: 'public://images/pictures/'
plugin: csv
track_changes: true
# Full path to the file.
path: '/Library/WebServer/Documents/drupal/modules/custom/migrate_csv/assets/csv/articles.csv'
header_row_count: 1
keys:
- name
column_names:
3:
name: Picture
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: { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment