Migration From Drupal 7 to Drupal 8: How do I find which items were ignored?

You are migrating from Drupal 7 to Drupal 8 and you have ignored items after you run a migration. This leads to the very important question of which ones were ignored?

What you see

[notice] Processed 632 items (630 created, 0 updated, 0 failed, 2 ignored) - done with 'node_form'

The above is what I will use in my examples.

What you want to know

What are the items ignored!? For this we can look into the database. I assume you have access to a console…

The migrate_map_migration_name table in your database will give you the information you need. There will be a column named source_row_status. The value of 2 equals the status of ignored. So run the following MySQL command:

SELECT * FROM `migrate_map_node_form` WHERE source_row_status = 2;

The sourceid1 column of the returned rows will contain the id of the item that was ignored.

Example output:

source_ids_hash sourceid1 destid1 source_row_status source_row_status last_imported hash
8530eb5d63ad4cfea47134a28e3339e089f639164d218287c3… 10931 NULL 2 0 0
ddd550e747c2a26a2a5058d49be0e146616fd5c45f6bef88f3… 11656 NULL 2 0 0

Answers on stackoverflow.

Migration of Files from Dupal 7 to Drupal 8 with: [notice] Field discovery failed for Drupal core version 7. Did this site have the CCK or Field module installed? Error: No database connection configured for source plugin d7_field_instance

When migrating files in Drupal 7 to Drupal 8 you receive one or more notices:

[notice] Field discovery failed for Drupal core version 7. Did this site have the CCK or Field module installed? Error: No database connection configured for source plugin d7_field_instance

At the end of the migration you will see something like this:

[notice] Processed 2607 items (2474 created, 0 updated, 15 failed, 118 ignored) - done with 'file'

The numbers will be different according to the amount of files you are migrating. In my case each of the 118 ignored files all had generated [notice] Field discovery failed....

After looking through the database I found that one of my fields held reference data to a user that no longer existed.

Process I took to find the problem

  1. Google and Drupal site
    1. There was very little information to be found with searching for: [notice] Field discovery failed for Drupal core version 7. Did this site have the CCK or Field module installed? Error: No database connection configured for source plugin d7_field_instance.
  2. Dive into the database – splash
    1. Find which files didn’t get migrated from the migration map with MYSQL on the D8 database.
      SELECT * FROM `migrate_map_file` where source_row_status <> 0;
      
      You’ll want to note that all the files that don’t have a d8_database > migrate_map_file > migrate_map_status of 0 are not created. The status of 2 means the file is ignored and 3 means it failed the migration.
    2. Use MYSQL on the D7 database to select a few files each that were ignored and created.
      SELECT * FROM `file_managed` WHERE fid = 5981 OR fid = 6051 OR fid = 5816 OR fid = 6906 OR fid = 16231 OR fid = 3709
      
      The file_managed table is where you can pull each FID (field id) from the fid column. In the example the last two FIDs where files that were created. The other 3 FIDs where ones that had been ignored. By comparing these I found that the only thing that stood out was the UIDs (user ids). A couple of the files ignored had the same UID.
    3. On the Drupal 7 site I viewed the user by the UID (mysite.com/user/123). This ended up in a page not found. You can also check this in the database with the following command.
      SELECT * FROM `users` WHERE uid = 123;
      

Conclusion

There were files with an author that no longer existed in the database. As an example, the file with the FID of 5981. This file referenced the author, which was a user, with a UID of 123 that was no longer in the database. This caused the notice and for the file to be ignored in the migration.