Running a Drupal 6 to Drupal 8 migration using the migrate/upgrade UI, the files are migrated and attached to the nodes.

Executing a custom migration:

I export the config:

drush8 migrate-upgrade --configure-only --legacy-db-url=mysql://drupaluser:@127.0.0.1:33067/drupal6 --legacy-root=/Users/Jon/Sites/devdesktop/drupal-6.38

Create a module to hold the exported config:

drupal generate:module

mkdir modules/custom/d6migrate/config
mkdir modules/custom/d6migrate/config/install

drupal config:export

cp ..../sync/migrate_plus.migration* modules/custom/dr6source/config/install/
rm modules/custom/d6migration/config/install/migrate_plus.migration_group.default.yml

Enable the custom module and run the migration.

drush8 en d6migrate -y

drush mi --all

RESULT

Everything is migrated, including the files. However, the files are not attached to the nodes. They do show up at /admin/content/files.

I ran through this scenario again this morning, using the latest dev releases of migrate_tools, etc. I noticed 2 errors in the console:

The "link" plugin does not exist. [error]

(/Users/Jon/Sites/devdesktop/d8full/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)

The "filefield_widget" plugin does not exist. [error]

(/Users/Jon/Sites/devdesktop/d8full/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

jonreid created an issue. See original summary.

mikeryan’s picture

Project: Drupal core » Migrate Upgrade
Version: 8.1.x-dev » 8.x-2.x-dev
Component: migration system » Code

Since apparently this worked when running the straight core upgrade, the first place to look to diagnose this would be in migrate_upgrade (making sure the migrations were properly generated).

niccottrell’s picture

@jonreid did you make any progress on this? I am having this problem with D8.1.3 except files were not even inserted into the files_managed table (although it worked fine migrating to D8.0.x from the same source D6 site).

@mikeryan What is the link plugin? part of the migrate module? or some D6 widget perhaps?

My errors are reported as:

The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)[error]
Processed 91 items (75 created, 0 updated, 8 failed, 8 ignored) - done with                                  [status]
'upgrade_d6_field_instance_widget_settings'

My upgrade_d6_field_instance_widget_settings.yml looks like:

uuid: cb013b88-a8f8-41a4-afab-c09fa755e958
langcode: en
status: true
dependencies: {  }
id: upgrade_d6_field_instance_widget_settings
migration_tags:
  - 'Drupal 6'
migration_group: migrate_drupal_6
label: 'Field instance widget configuration'
source:
  plugin: d6_field_instance_per_form_display
  constants:
    entity_type: node
    form_mode: default
    third_party_settings: {  }
process:
  field_type_exists:
    -
      plugin: migration
      migration: upgrade_d6_field
      source:
        - field_name
    -
      plugin: extract
      index:
        - 1
    -
      plugin: skip_on_empty
      method: row
  bundle:
    -
      plugin: migration
      migration: upgrade_d6_node_type
      source: type_name
    -
      plugin: skip_on_empty
      method: row
  form_mode: constants/form_mode
  field_name: field_name
  entity_type: constants/entity_type
  options/weight: weight
  options/type:
    type:
      plugin: static_map
      bypass: true
      source: widget_type
      map:
        number: number
        email_textfield: email_default
        date_select: datetime_default
        date_text: datetime_default
        imagefield_widget: image_image
        phone_textfield: telephone_default
        optionwidgets_onoff: boolean_checkbox
        optionwidgets_buttons: options_buttons
        optionwidgets_select: options_select
  options/settings:
    -
      plugin: field_instance_widget_settings
      source:
        - widget_type
        - widget_settings
  options/third_party_settings: constants/third_party_settings
destination:
  plugin: component_entity_form_display
migration_dependencies:
  required:
    - upgrade_d6_field_instance
  optional: {  }

Does this mean anything to anyone?

mikeryan’s picture

Status: Active » Closed (duplicate)
Related issues: +#2640842: Make related file migration ID configurable in d6_cck_file

There are three different "link" plugins in core, of types FieldFormatter, FieldType, and MigrateCckField - the latter of course the most likely issue here. All of these plugins are defined in the link module, so you need to have that module installed on D8 to be able to migrate link fields from D6.

Now, that being said, it has nothing to do with the main issue here - file reference fields not being populated. That is almost certainly #2640842: Make related file migration ID configurable in d6_cck_file - the d6_cck_file process plugin has a hardcoded reference to the d6_file migration, and when you set up custom migrations like this and the migration IDs change d6_cck_file won't work right. That needs to be addressed in the core issue.

niccottrell’s picture

My migrate_plus.migration.upgrade_d6_node_CONTENTYPE.yml indeed has lines:

 field_gallery:
    plugin: d6_cck_file
    source: field_gallery

and the migration reports success.

@mikeryan when you say "the migration IDs' do you mean the uuid in the yml file? I just did a migrate from scratch on a fresh D8 with empty database. I reused the YAML files from a previous attempt that I had saved into a custom module. So I went straight to drush mi without having run drush mu --configure-only this time. So there should be no UUID conflicts, right?

niccottrell’s picture

Status: Closed (duplicate) » Active
niccottrell’s picture

It looks like this problem remains even when the D8 core link module is enabled before I start the migrate. In fact the errors seem to start before we get to _instance_widget_settings, e.g.

Processed 81 items (75 created, 0 updated, 0 failed, 6 ignored) - done with 'upgrade_d6_field'                                                                                                            [status]
Processed 91 items (83 created, 0 updated, 0 failed, 8 ignored) - done with 'upgrade_d6_field_instance'                                                                                                   [status]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
The "link" plugin does not exist. (/www/cn8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                             [error]
Processed 91 items (75 created, 0 updated, 8 failed, 8 ignored) - done with 'upgrade_d6_field_instance_widget_settings'                                                                                   [status]

P.S. It would be great if the migrator could list which items were ignored.

P.P.S. Is it worth trying the migrate_upgrade 8.x-2.x-dev version from 2016-Sep-01 rather than rc1 and/or migrate_plus 8.x-2.x-dev from 2016-Sep-21?

P.P.P.S. I looked at https://api.drupal.org/api/drupal/core!modules!file!src!Plugin!migrate!p... but I don't see any hardcoded uuid in there...

mikeryan’s picture

Status: Active » Closed (duplicate)

This issue is "Files not attached to nodes using drush migrate-import" - issues with the link plugin would be a separate issue.

drzraf’s picture

BarisW’s picture

Having the same with a D6 > D8 migration.

Processed 356 items (14 created, 0 updated, 342 failed, 0 ignored) - done with 'upgrade_d6_field_formatter_settings'
The "filefield_widget" plugin does not exist. (/htdocs/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)
Processed 74 items (61 created, 0 updated, 1 failed, 12 ignored) - done with 'upgrade_d6_field_instance_widget_settings'
osopolar’s picture

Status: Closed (duplicate) » Active
FileSize
1.71 KB

Sorry @mikeryan, for reopening this issue.

I got stuck with same problem as #1 and #10, I get two times the following error and don't know how to proceed:

The "filefield_widget" plugin does not exist. (/path-to-drupal/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)

My migrate_plus.migration.upgrade_d6_field_instance_widget_settings.yml file looks similar to the on in #3, provided by custom module following the instructions from Custom Drupal-to-Drupal Migrations with Migrate Tools, see attachment.

osopolar’s picture

BTW: In my case the files that do not get attached to the node are images (image field) not plain files (from file field). The files get migrated correctly before the nodes gets migrated. So far I can't see the problem. Any advices how to debug the problem?

Edit:
On upgrading by using the migration ui, images are attached correctly.

osopolar’s picture

I found the problem, the migration process in CckFile:transform() can't match the fid's. My migrate_plus.migration.upgrade_d6_node_CONTENTYPE-NAME.yml had these lines:

  field_image:
    plugin: d6_cck_file
    source: field_image

I found the solution in the change record: d6_cck_file process plugin now takes optional 'migration' option. Adding migration: upgrade_d6_file solves the problem:

  field_image:
    plugin: d6_cck_file
    source: field_image
    migration: upgrade_d6_file

So it does not seem to be a bug of Migrate Upgrade, maybe it should be a follow-up of #2640842: Make related file migration ID configurable in d6_cck_file?

albertski’s picture

I'm running into same issues:

Processed 170 items (7 created, 0 updated, 163 failed, 0 ignored) - done with 'upgrade_d6_field_formatter_settings'                                                                                                         [status]
The "link" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                                 [error]
The "filefield_widget" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                     [error]
The "link" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                                 [error]
The "filefield_widget" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                     [error]
The "link" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                                 [error]
The "filefield_widget" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                     [error]
The "filefield_widget" plugin does not exist. (/var/www/mysite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)                                                                                     [error]
Processed 46 items (27 created, 0 updated, 7 failed, 12 ignored) - done with 'upgrade_d6_field_instance_widget_settings'

I am using 8.x-3.0 modules and verified that patch from #2640842: Make related file migration ID configurable in d6_cck_file is already in. I'm going to try what @osopolar did.

albertski’s picture

@osopolar

I tried your solution of adding migration: upgrade_d6_file to all my file fields but I'm also getting the error:

The "filefield_widget" plugin does not exist.

Did you by any chance do anything else to get it to work?

osopolar’s picture

@albertski: You are right, it didn't work for filefields, but for imagefields.

I also had to add filefield_widget: file_generic to my migrate_plus.migration.upgrade_d6_field_instance_widget_settings.yml file, see #2563343: d6_field_instance_widget_settings seems to fail with filefield_widgets.

albertski’s picture

Thanks @osopolar! Adding filefield_widget: file_generic to migrate_plus.migration.upgrade_d6_field_instance_widget_settings.yml and adding migration: upgrade_d6_file to the node yml files fixed the issue.

Now looking into: The "link" plugin does not exist.

albertski’s picture

I had a similar fix for link. I added: link: link_default to options/type - map in migrate_plus.migration.upgrade_d6_field_instance_widget_settings.yml and now my llinks get migrated.

heddn’s picture

Status: Active » Fixed

Looks like this was fixed in #13.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.