Translation Errors When Migrating Drupal 6 Uploads

Feb 13, 2020 - 4:37pm


I've been hitting errors with a D6 migration.

First, I hit this error:

[error]  InvalidArgumentException: Field upload is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of /.../core/lib/Drupal/Core/Entity/ContentEntityBase.php). 
[error]  Field upload is unknown. (/.../core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:846) 

Though the field name was different, this solution worked for me.  To sum it up:

  1. Revert the specific migration: drush migrate:rollback upgrade_d6_upload
  2. Run drush updb
  3. Run drush cr
  4. Rerun the migration: drush migrate:import upgrade_d6_upload

That got rid of the first slew of errors and allowed most of the items to migrate.

But then there were new errors:

[error]  InvalidArgumentException: The entity cannot be translated since it is language neutral (und). in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 958 of /.../core/lib/Drupal/Core/Entity/ContentEntityBase.php). 
[error]  The entity cannot be translated since it is language neutral (und). (/.../core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:846) 

The solution for these new errors was to "unlock" the und language.  Thanks to diewe for this solution!

  1. Enable the language module.
  2. Export the config.
  3. Edit the language.entity.und.yml, changing locked to true.
  4. Import the config.
  5. Rollback and reimport upgrade_d6_upload

All uploads then migrated without error.

Add new comment