Problems with prefix option on D6 File migration

Created on 11 September 2018, over 6 years ago
Updated 12 March 2025, 28 days ago

There is an issue with prefixed migrations when it comes to mapping migrated files to a file field. This has been discussed and addressed in related issues.

The root cause for the problems is pointed out here: #2767237-13: Files not attached to nodes using drush migrate-import

The plugin d6_cck_file resp. d6_field_file accepts an argument "migration" which needs to be prefixed as well. And in default configuration this argument is not explicitly set (only implicit with a default of "d6_file").

But the patch from issue #2826204: migration using d6_cck_file/d6_field_file process plugin does not work with migration-prefix drush option does not work as far as I can tell.

I will provide an alternative patch for maybe fixing this.

🐛 Bug report
Status

Postponed: needs info

Version

3.0

Component

Code

Created by

🇩🇪Germany stefan.korn Jossgrund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Grevil

    I am unsure, if this is related, but in line 81 of the core `core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php` process-plugin a hard coded `d6_file` is used for the migration lookup:

        $lookup_result = $this->migrateLookup->lookup('d6_file', [$value['fid']]);
    

    Unfortunately, this will cause a problem when migrating d6 file field instances, as the migration id "d6_file" is not resolvable, when using "migrate_upgrade" as the actual migration id is prefixed with "upgrade_". Meaning, once migrate_upgrade is activated, this id should get overwritten with "upgrade_d6_file" instead:

        $lookup_result = $this->migrateLookup->lookup('upgrade_d6_file', [$value['fid']]);
    

    But this would probably need changes in the core file first?

Production build 0.71.5 2024