Import url_alias from csv
Issue #3029827 on drupal.org by rj-y.
I'm trying to import url_alias from csv to drupal basic page content. Below is the migration script i'm using and getting the below error while running this script. Please help on this.
Migration script: (yml file)
id: migrate_csv_url
label: 'Migrate url_alias from the csv file'
source:
plugin: csv
# Full path to the file.
path: 'localpath/modules/custom/migrate_csv_url/assets/csv/migrate_csv_url.csv'
header_row_count: 1
keys:
- ID
# Adding constant value.
constants:
status: 1
process:
# Adding the mapping between the fields and the csv columns.
field_first_name: First Name
field_last_name: Last Name
status: constants/status
destination:
plugin: 'entity:user'
migration_dependencies:
required: { }
optional: { }
csv data:
ID,Title,Body,First Name,Last Name,path,langcode
1,Text1,"some text1",Joe,B,"/en/some/hello1",en
2,Text2,"some text2",Rakesh,James,"/en/some/hello2",en
3,Text3,"some text3",Jack,David,"/en/some/hello3",en
4,Text4,"some text4",D,D,"/en/some/hello4",en
Error:
#drush ms
Drupal/Migrate/MigrateException: You must declare "keys" as a unique array of fields in your source settings.