Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Expose the ability to rollback items no longer included in source data to Drush once #2809433: Migrate support for deleting items no longer in the incoming data is complete.
Comment | File | Size | Author |
---|---|---|---|
#41 | migrate_tools_2863426-V6.0.4-2.patch | 2.17 KB | Alsén |
migrate_tools_2863426-V6.0.4.patch | 2.16 KB | Alsén | |
#39 | migrate_tools_2863426-V6.0.2.patch | 2.08 KB | Alsén |
#38 | migrate_tools_2863426-V6.patch | 2.08 KB | pilot3 |
#37 | migrate_tools_2863426.patch | 2.13 KB | ras-ben |
Comments
Comment #2
kevin.dutra CreditAttribution: kevin.dutra at Workday, Inc. commentedBased on the current direction, this is what would be needed.
Comment #3
joelpittetAs long as the other patch gets in, this one seems to be working well:) Thanks @kevin.dutra
Comment #4
mikeryanBlocked on the core issue.
Comment #5
bucefal91 CreditAttribution: bucefal91 for Websolutions Agency commentedhello, guys! :)
Since #2914005: Drush 9 port of commands went into Migrate tools, I believe the patch here from comment #2 lacks support for that Drush 9 part. I am attaching a patch that keeps all of kevin.dutra's work + support for Drush 9 with the same functionality/interface (
--missing-from-source
). I've tested it locally on Drush 9.I am moving the issue status to "needs review" since there's a new patch to review (I assume if my patch is acceptable, then we can move it back to postponed until the core catches up).
Also, I believe the targeted version is 8.x-4.x, isn't it? At least my patch is against 8.x-4.x.
Comment #6
Peacog CreditAttribution: Peacog as a volunteer commentedNeeded a re-roll because of some short array syntax changes in migrate_tools.drush.inc
Comment #7
aperedos CreditAttribution: aperedos commentedThanks for your code, if you want to remove missing items from code you can use:
Example: How to start a migration programmatically
Comment #8
jeff.hartman CreditAttribution: jeff.hartman commentedWould love to see this for Drupal 7 too.
Comment #9
Majdi CreditAttribution: Majdi as a volunteer commented@jeff.hartman I think this issue for D7 #1416672: Optionally delete destination when source data is removed (with tests)
Comment #10
heddnComment #11
Peacog CreditAttribution: Peacog as a volunteer commentedRe-rolled
Comment #12
rpayanmComment #13
heddnWaiting on #2809433: Migrate support for deleting items no longer in the incoming data to land.
Comment #14
wizonesolutionsI needed this while we're still waiting for the other issue, so I re-rolled the patch. Up to y'all if you want to set it to "Needs review"; not gonna interfere with the issue status.
Comment #15
lathananother patch reroll
Comment #16
byrond CreditAttribution: byrond commentedI'm interested in using the "limit" option while rolling back missing items, as processing large numbers of rows on cron will cause it to timeout. I assume migrate_tools may need to override
migrateMissingItems()
once #2809433 is merged. Is that correct? For now, I'll be adding that function from the core issue to a custom module and overriding it there.Comment #17
KarlSheaReroll
Comment #18
KarlSheaComment #19
achraf.noomane CreditAttribution: achraf.noomane at Interpersonal Frequency commentedPatch rerolled for migrate_tools 4.0 on Drupal 8.6.7
Comment #20
achraf.noomane CreditAttribution: achraf.noomane at Interpersonal Frequency commentedPatch rolled for migrate_tools 4.1
Comment #21
vidorado CreditAttribution: vidorado at Biko2 commentedNote that this patch doesn't work well and does nothing if you don't apply also the core patch from #2809433: Migrate support for deleting items no longer in the incoming data. This patch only exposes the new funcionality added in that other patch through the drush command migrate:rollback
Comment #22
marvil07 CreditAttribution: marvil07 at Isovera commentedThe last patch was not applying anymore, I have just re-rolled it.
It is important to notice that even if this patch was written when the related #2809433: Migrate support for deleting items no longer in the incoming data was targeting core, the method in migrate_tools executable have not
changed its name, and therefore the changes here are still valid.
Comment #23
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedRe-rolled!
Comment #24
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedMy bad, @marvil07's patch works fine.
Comment #25
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedCan someone make me understand what wrong I have done while creating the patch ?
I can see some ambiguity in code: https://git.drupalcode.org/project/migrate_tools/blob/8.x-4.x/migrate_to... and the above patch.
Line #79 is different in both code and patch, even though the patch is created from 8.x-4.x branch.
Comment #26
jds1Noting that my experience here is that the patch in #22 does not apply to 4.1.0 – only to 4.x-dev.
Comment #27
agileadamFor what it's worth, the following patches are playing well together after going from Drupal 8.5 to 8.7.3.
It took me some time to find a working combination.
Comment #28
damontgomery CreditAttribution: damontgomery at Palantir.net for Tableau commentedAs commented in the sister story, https://www.drupal.org/project/migrate_tools/issues/2809433#comment-1317..., this works for us with #20 and 8.x-4.1.
Thanks!
Comment #29
Peacog CreditAttribution: Peacog as a volunteer commentedI was having problems running the rollback command more than once. It would work after clearing the cache, but subsequent runs would fail with the error
You must specify --all, --group, --tag, or one or more migration names separated by commas
.It turns out the the order or the command line arguments is important. The correct usage is
migrate-rollback beer_term --missing-from-source
.Here's a patch that updates the usage documentation.
Comment #30
FeyP CreditAttribution: FeyP as a volunteer and at werk21 commentedI tried to use this patch with Drush 8 and while the patch looks good and it applies without error, it seems that git still fails to apply it correctly to the latest 8.x-4.x-dev. git merges the new option into the arguments section of the rollback command instead of the options section, resulting in a
Unknown option: --missing-from-source.
error when you try to use it. Attached is an updated version of the patch that should fix this.Comment #31
lammensj CreditAttribution: lammensj at Digiti commentedUpdated the patch for 8.x-4.5.
Comment #32
heddnThis could be closed duplicate or closed won't fix. See #2809433: Migrate support for deleting items no longer in the incoming data. Closing dup.
Comment #33
john.oltman CreditAttribution: john.oltman commentedThe patch in #31 didn't work for me with 8.x-4.5. New patch attached.
Comment #34
fabienlyHello, the patch in #33 didn't work for me with 8.x-5.0.0 due to missing migrate_tools.drush.inc file.
Comment #35
visantinian CreditAttribution: visantinian commentedUpdated patch against latest version of the module
Comment #36
visantinian CreditAttribution: visantinian commentedComment #37
ras-ben CreditAttribution: ras-ben commentedI havent had a chance to test the work yet, but this is a port of the work in #36 to work with the latest 5.0 version.
Bare in mind that you'll need this patch also, for this to work:
https://www.drupal.org/project/migrate_tools/issues/2809433#comment-1307...
Comment #38
pilot3 CreditAttribution: pilot3 at Palantir.net commentedThis migrate_tools_2863426.patch doesn't apply anymore when I upgrade to 6.0 version for D10 compatibility. I updated the patch for version 6.0.
Comment #39
Alsén CreditAttribution: Alsén at Happiness commentedMigrateToolsCommands.php is moved in 6.0.2 from src/Commands/ to src/Drush/
Comment #41
Alsén CreditAttribution: Alsén at Happiness commentedUpdate patch for version 6.0.4.