Allow the idlist option to work on the primary ID of source plugins containing multiple IDs

Created on 19 August 2021, almost 3 years ago
Updated 1 September 2023, 10 months ago

Problem/Motivation

Some migration sources require multiple IDs e.g. node revisions (nid, vid, language).

It'd be nice to be able to specify just the nid and allow it to apply the update against the nid, and if you still require a specific entry, you can specify the full entry including the vid and language.

Steps to reproduce

Running a command such as this should be possible:

# Run a migration against all of node 1's revisions.
drush migrate:import d7_node_complete__page --update --idlist=1

Rather than:

# Run a migration against all of node 1's revisions.
drush migrate:import d7_node_complete__page --update --idlist=1:1:und,1:2:und,1:3:und

Proposed resolution

Provide the functionality. Will most likely require a patch in core as well.

Remaining tasks

Provide a patch/MR.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Needs work

Version

5.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    37 pass
  • πŸ‡¬πŸ‡§United Kingdom joachim

    This now has tests and is green -- is it ready for review?

  • πŸ‡ΊπŸ‡ΈUnited States apotek

    I came upon this issue while exploring why --idlist was not working when I have two source id columns.

    I am looking at the thread here, and the thread has tilted away from the original title (allow idlist to work with multiple source ids) to more of a "filter ids by pattern" type of request. While I am 100% in favor being able to specify ids based on a pattern (sounds very useful to me), it sounds like it would be better solved for by using a new migrate option, such as `--idfilter=` instead of trying to buckle this onto an option that is meant to be a very direct and simple list of source ids.

    For filtering ids by pattern, I think we need a feature request (and a similar patch).

    But this ticket and thread is about allowing migrations to work from the command line using --idlist as is, when you have more than one source column and I feel that issue is its own issue without mixing in filtering. Does this make sense?

Production build 0.69.0 2024