Pixeldust Drupal Support Service

Why is migration lookup failing during synchronisation of Group entities?

Providing Custom Web Development Services Since 2000

Why is migration lookup failing during synchronisation of Group entities?

On the basis of an RSS feed, I am required to create Group entities and Users out of the feed’s items.

Each item contains sufficient data:

<item>   <id>123</id>   <title>An example</title>   <description>Some &lt;strong&gt;HTML&lt;/strong&gt; description.</description>   <author>John Doe</author>   <email>john.doe@example.com</email>   <pub_date>09/19/2017 - 08:30</pub_date> </item> 

I am using Core’s migration module along with migrate_plus and migrate_tools and wrote two migration yml files, one for creating Group entities out of the items and one to generate users out of the author & email fields.

Taken separately, both work fine, that is I am getting Group entities and User entities as expected. The only issue which I can’t get my head wrapped around is to set the respective User to be the Group’s owner.

Here’s the processing part of the Group yml file:

process:   uid:     plugin: migration_lookup     migration: migrate_plus.migration.users     no_stub: true     source: email   label: title   field_description: description   created:     plugin: format_date     from_format: 'm/d/Y - H:i'     to_format: 'U'     source: pub_date   status:     plugin: default_value     default_value: 1   type:     plugin: default_value     default_value: my_group_type  migration_dependencies:   required:     - migrate_plus.migration.users 

All fields except for uid are set correctly. If I change the user id process part to something static like

  uid:     plugin: default_value     default_value: 1 

it works as well and the Group’s owner is set to the Super User account. So, I reckon there’s something wrong with the migration_lookup processing part. I have read numerous tutorials on how to use that and it looks fine to me. I also read that migration_lookup fails silently if there is an error which makes it hard to debug.

Looking at the migration map table in the database it looks fine too:

mysql> select * from migrate_map_users limit 1; +-----------------+----------------------+---------+-------------------+-----------------+---------------+------+ | source_ids_hash | sourceid1            | destid1 | source_row_status | rollback_action | last_imported | hash | +-----------------+----------------------+---------+-------------------+-----------------+---------------+------+ | 009d...234ef457 | john.doe@example.com |     118 |                 0 |               0 |             0 |      | +-----------------+----------------------+---------+-------------------+-----------------+---------------+------+ 1 row in set (0.00 sec) 

Due to the migration dependency through

migration_dependencies:   required:     - migrate_plus.migration.users 

the User migration should also run first, but it still doesn’t work. Even after both migrations have run through, I tried an update migration run, but the Group’s owner is never set (stays at being 0/Anonymous).

Is there soemthing wrong with my yml file? Are there other means to connect user and groups?

Sponsored by SupremePR
This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Why is migration lookup failing during synchronisation of Group entities?

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.