Problem/Motivation

Now idlist command no support multiple souceids e.g I have three sourceids:

    - id_profile
    - year
    - trim

If I need migrate one row with idprofile=3, year=2014,trim=3 sources I can not.

Proposed resolution

Updated the command to do:
drush mi migration_test --idlist="sourceid1,sourceid2,sourceid3"

e.g for multiple
drush mi migration_test --idlist="3:2014:3,2:2011:2"
e.g for single sourceid
drush mi migration_test --idlist="2"

Remaining tasks

Write a patch.

Comments

edysmp created an issue. See original summary.

edysmp’s picture

Status: Active » Needs review
StatusFileSize
new1.72 KB
mikeryan’s picture

edysmp’s picture

Assigned: Unassigned » edysmp
edysmp’s picture

Assigned: edysmp » Unassigned
StatusFileSize
new986 bytes
new1.38 KB
edysmp’s picture

Issue summary: View changes
edysmp’s picture

Issue summary: View changes
quietone’s picture

I tested this with d7_block, which has 3 source ids. It worked for importing a single block but failed for a multiple.

$ drush mi upgrade_d7_block --idlist="system:main:bartik,system:main:seven"    
Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d7_block' 
$ drush mi upgrade_d7_block --idlist="system:main:seven"
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d7_block' 
$ drush mi upgrade_d7_block --idlist="system:main:bartik"
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d7_block'   

Should this feature also be available for rollback?

edysmp’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
StatusFileSize
new1.42 KB

Thanks @quitone for review, here a new path :), So for rollback seem right, a subscriber to MigrateEvents::PRE_ROW_DELETE?

mikeryan’s picture

idlist is not currently supported for rollback at all - that should be a separate issue.

  • mikeryan committed e40849e on 8.x-2.x authored by edysmp
    Issue #2698067 by edysmp: Make idlist command support multiple sourceids
    
mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

badrange’s picture

This fix created a bug for us who are fetching data from a source a colon in the IDs. I created a patch here:
https://www.drupal.org/project/migrate_tools/issues/2915099