In a custom module (assoc), I have a custom Content Entity (Person) with these fields:
$fields['lastname'] = BaseFieldDefinition::create('string')
$fields['firstname'] = BaseFieldDefinition::create('string')
$fields['email'] = BaseFieldDefinition::create('email')
$fields['cellphone'] = BaseFieldDefinition::create('telephone')
I migrated Person content from a Drupal 6 site using Migrate Source CSV, Migrate Plus, Migrate Tools and this migration file:
id: migration_persons
migration_tags: null
migration_group: null
label: 'Person migration from CSV'
source:
plugin: csv
path: /Users/efalzon/Sites/JdP8M7b/config/migration_Persons.csv
delimiter: ';'
enclosure: '"'
header_row_count: 1
keys:
- id
process:
id: id
lastname: lastname
firstname: firstname
cellphone: cellphone
email: mail
iscontact: iscontact
isactive: isactive
member_id: member_id
user_id: user_id
owner_id:
plugin: default_value
default_value: 1
destination:
plugin: 'entity:person'
migration_dependencies:
required: {}
optional: {}
I added a field to this entity using the UI:
The corresponding config files are field.storage.person.field_sel_initial_credit.yml
and field.field.person.person.field_sel_initial_credit.yml
I tried to migrate some content to this field using
id: migration_sel_initial_credit
migration_tags: null
migration_group: null
label: 'Sel initial credit migration from CSV'
source:
plugin: csv
path: /Users/efalzon/Sites/JdP8M7b/config/migration_Sel_initial_credit.csv
delimiter: ';'
enclosure: '"'
header_row_count: 1
keys:
- uid
process:
bundle: "person"
entity_id: uid
revision_id: uid
field_sel_initial_credit_value: value
destination:
plugin: 'entity:field_storage_config'
migration_dependencies:
required: {}
optional: {}
and I got this error when executing the migration:
[error] Attempt to create a field storage without a field name. (/Users/efalzon/Sites/JdP8M7b/web/core/modules/field/src/Entity/FieldStorageConfig.php:252)
What am i missing?
destination: plugin: 'entity:field_storage_config'
, which should most likely bedestination: plugin: 'entity:person'
. BUT: Migration a very strict1 source:1 target
entity mapping, you can't update a single field this way. Read the docs for themigration_lookup
process plugin.migrate field_sel_initial_credit_value
at the same time?