Problem/Motivation

When migrating taxonomy terms from Drupal 7 to Drupal 11, if the Drupal 7 database has hierarchical terms where the parent term's tid is greater than the child term's tid, the parent-child relationship is not preserved in the migration. In the migrated Drupal 11 site, the child term winds up at the top level (no parent).

Steps to reproduce

  • Create a Drupal 7 site with some taxonomy terms.
  • Create at least one term that becomes the parent of one or more terms that were previously created.
  • Set up a Drupal 11 site that references the Drupal 7 database for migration.
  • drush migrate-import d7_taxonomy_term:[vocabulary] (where [vocabulary] is the vocabulary used when you created the terms)

Proposed resolution

I realize this is related to other issues where migration_lookup is unable to create stubs under certain circumstances, and this is one of those circumstances. However, an easy fix for this particular instance is to change the migrate source to take the taxonomy_term_hierarchy parent_id into account, and order the taxonomy terms by parent id and then tid. This ensures any parent term will be migrated before their children.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3530887

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

paulmckibben created an issue. See original summary.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Status: Active » Closed (won't fix)

The Migrate Drupal Module and Migrate Drupal UI are deprecated and they are not in Drupal 12.0.0.

Issues for these modules should now be on the 11.x branch. And the changes are limited to critical and major bug fixes. Other changes are allowed at the discretion of the core Release Managers in consultation with the Migrate subsystem maintainers.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.