Closed (duplicate)
Project:
Drupal core
Version:
8.4.x-dev
Component:
migration system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jun 2016 at 07:21 UTC
Updated:
10 Mar 2017 at 23:40 UTC
Jump to comment: Most recent
Comments
Comment #2
mikeryanThat's a bit... vague. I'm guessing you mean deleting migrated data when the source data is no longer present? That's a lot harder than you may be imagining - see the D7 discussion at #1416672: Optionally delete destination when source data is removed (with tests).
Comment #3
mpp commentedHey Mike, thanks for your feedback.
I'm already following that issue and I thought I had linked it here.. bizarre. Anyhow, thanks for linking it!
Atm, the only solutions I can come up with is adding a flag with the publication status and then performing a migrate --update which will not actually delete data OR a implement a POST_ROW_SAVE event to manually delete data which just seems wrong..
Comment #4
chx commentedI will not decide whether this should or should not be done but if the decision is positive then it should be implemented like this: add a delete_property to the destination plugin configuration and if that property is true-ish then execute a delete. So:
This is easy to implement and aligns with the whole system: much like constants are not a fixed property name to avoid clashes with existing property names, this is also not fixed to anything (like
deleteor somesuch) but is configurable. All the logic is still in process where it belongs. And everything is explicit and manual. Whether or not highwater should be adjusted in case of a delete can be another option.Comment #5
mpp commentedHi chx, that looks much better indeed! Is there a place where I can get some more information on the highwater property?
Comment #7
geerlingguy commentedAnother related issue (with a patch for 8.1.x): #2809433: Migrate support for deleting items no longer in the incoming data.
Comment #9
mikeryanSuperceded by #2809433: Migrate support for deleting items no longer in the incoming data.