Closed (duplicate)
Project:
Migrate Tools
Version:
6.0.4
Component:
Drush commands
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2017 at 17:34 UTC
Updated:
14 Mar 2024 at 10:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kevin.dutra 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 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 commentedNeeded a re-roll because of some short array syntax changes in migrate_tools.drush.inc
Comment #7
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 commentedWould love to see this for Drupal 7 too.
Comment #9
majdi 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 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
roam2345 commentedanother patch reroll
Comment #16
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 commentedPatch rerolled for migrate_tools 4.0 on Drupal 8.6.7
Comment #20
achraf.noomane commentedPatch rolled for migrate_tools 4.1
Comment #21
vidorado 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 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 commentedRe-rolled!
Comment #24
navneet0693 commentedMy bad, @marvil07's patch works fine.
Comment #25
navneet0693 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 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 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 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 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 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 commentedUpdated patch against latest version of the module
Comment #36
visantinian commentedComment #37
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 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
thomas alsén commentedMigrateToolsCommands.php is moved in 6.0.2 from src/Commands/ to src/Drush/
Comment #41
thomas alsén commentedUpdate patch for version 6.0.4.