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.

Drupal 8: Missing Login

Drupal 8: What happened to my login page!?

The Short

If you are working on the page.html.twig file and you now can’t get to the login screen confirm you are rendering the content section in your template by having {{ page.content }} in the page.html.twig file.

The Long

Recently, I have been learning to use Drupal 8 while at the same time getting more and more familiar with Drupal 7. I hit a little problem along the way and thought I would share as Drupal is notoriously hard to find information on when you need it. Unfortunately, part of the reason why is because if you read the documentation you can figure it out with some effort.

Who wants to put that kind of effort into it when it seems like there is a simple fix? So here is a simple fix or something you can check if you have a similar problem.

What I was doing…

I was in the process of building a custom theme and was building a template using YOURTHEME/templates/page.html.twig.

After logging out I was unable to log back in. I tried logging in via the login path built into Drupal 8 (mysite.com/user/login). It came up with the same page as the main page I was working on. I determined the template was the problem by renaming the template so as not to be rendered by Drupal. Note you can’t clear the cache if you can’t login. You will have to run the drush in the command line in the root folder (the folder with sites in it…) of your site: drush cr. Now the login page work by going to mysite.com/user/login.

The problem was that I had defined the content area in the MYTHEME.info.yml but did not add the code to the template to render the content in the content area of my theme. To resolve enter {{ page.content }} where you want to render your login information in your theme. Clear the all caches and change the name of the template back to what it was (page.html.twig).