Skip to content

Instantly share code, notes, and snippets.

@rakeshjames
Last active April 5, 2018 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rakeshjames/fe016249441734637ebd0e772e78687a to your computer and use it in GitHub Desktop.
Save rakeshjames/fe016249441734637ebd0e772e78687a to your computer and use it in GitHub Desktop.
id: migrate_csv_users
label: 'Migrate users from the csv file'
migration_group: migration
source:
plugin: csv
# Full path to the file.
path: '/Library/WebServer/Documents/d8migrate.local/modules/custom/migrate_csv/assets/csv/migrate_csv_users.csv'
header_row_count: 1
keys:
- ID
# Adding constant value.
constants:
status: 1
process:
# Adding the mapping between the fields and the csv columns.
name: Name
mail: Email
roles:
plugin: explode
delimiter: ','
source: Roles
field_first_name: Firstname
field_last_name: Lastname
status: constants/status
# migrating the the password in plain texts.
pass:
plugin: callback
callable: md5
source: Password
destination:
plugin: 'entity:user'
md5_passwords: true
migration_dependencies:
required: { }
optional: { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment