Skip to content

Instantly share code, notes, and snippets.

@rakeshjames
Last active Apr 5, 2018
Embed
What would you like to do?
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