0

When doing a custom D7 to D8 migration, i sometimes need to migrate a specific value such as 'fid' (for example file ID of an images) into the

'field_image/target_id'

property. How do I find out which property i can use for D8 fields? By property i mean the target_id part. For example for uid field? The devel module does not seem to be helpful here, or I may be wrong.

0

You can use the EntityFieldManager. This is an example how to get the properties for the field uid of the entity node:

$fields = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('node');
$properties = $fields['uid']->getPropertyDefinitions();

From the command line you can use this in a drush php-eval command:

drush ev "var_dump(\Drupal::service('entity_field.manager')->getFieldStorageDefinitions('node')['uid']->getPropertyDefinitions())"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.