Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2748609: [meta] Preserving auto-increment IDs on migration is fragile
Problem/Motivation
Due to #2748609: [meta] Preserving auto-increment IDs on migration is fragile, we can get a quick win by just adding a comment into node, taxonomy, user and d7_file migration templates that suggestions that you might really, really want null out the entity id so you can actually possibly do incremental migrations.
Proposed resolution
Add a comment to all these migration templates saying you might want to remove the entity id.
Remaining tasks
Create a patch to do this.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#22 | interdiff-18-22.txt | 1.03 KB | Ada Hernandez |
#22 | add_comments_to_remove-2818157-22.patch | 6.51 KB | Ada Hernandez |
#18 | interdiff-13-18.txt | 2.29 KB | Ada Hernandez |
#18 | add_comments_to_remove-2818157-18.patch | 5.48 KB | Ada Hernandez |
Comments
Comment #2
heddnComment #3
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedI have added a patch with the commentaries in migration templates.
Comment #4
heddnThe comment for UID should be closer to the uid field. Can we move the uid field up higher so it is right next to the fid?
Same applies here for uid. Can we move it higher so the comment applies more closely?
And here. Move uid closer.
And here.
And here.
I don't think it makes sense to remove this one. The vid isn't a numeric identifier for taxonomy vocabularies.
I think this is similar to vocabularies. We don't want to remove it here.
I think this is similar to vocabularies. We don't want to remove it here.
Comment #5
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commented@heddn thanks for your feedback, I have removed the commentaries unnecessary.
Comment #6
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedComment #8
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commented@heddn now is the correct patch :).
Comment #9
mikeryanThe uid mapping should not be removed. If IDs are not preserved, the uid mapping should use the migration plugin instead of a straight mapping - but we have another issue to do that in general.
Ditto, uid mapping should not be removed.
Ditto.
Ditto.
Ditto, and etc. for the rest (I need to leave atm, haven't reviewed the rest...).
Comment #10
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commented@mikeryan thanks. I have removed the uid for templates migration now.
Comment #11
mikeryanSo, to be clearer and more complete than my dashed-off review yesterday - we only need to remove ID mappings from a migration when they are the primary ID of the entity being created by that migration. There are a number of subsidiary migrations which do not create entities themselves, where the primary ID is of an existing entity being updated - that ID must be mapped for the right entity to be updated.
With the changes below, I'll be ready to RTBC this. Thanks!
Actually, this one should not be removed, because it is properly mapping to the migrated nid (whether nids were preserved or not).
Similar to my previous uid reference - this must be mapped, and really should be using the migration plugin to work when IDs are not preserved, but we have a separate issue for that.
Ditto.
Comment #12
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commented@mikeryan thank you very much, I'll work in that
Comment #13
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedI updated the patch I removed the commentary for the ID must be mapped now I think this is correct.
Comment #14
mikeryanThat does it, thanks!
Comment #15
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedIt is a pleasure to help community
Comment #16
alexpottWouldn't you also have to comment the vid for the node migrations? (I might be wrong - but I think I had to do this on a recent migration).
Also aren't we missing comments?
Comment #17
mikeryanAh, right, should have caught that, thanks!
Comment #18
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedHi everyone, it did the changes for node templates
Comment #19
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedComment #20
mikeryanThere's also alexpott's second comment:
I.e., we need to also document this for the cid mappings in d6_comment and d7_comment.
Comment #21
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedOh!, ok thanks
Comment #22
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedI have added commentaries for comment migration template
Comment #23
mikeryanThanks!
Comment #24
alexpottCommitted and pushed f1b66f3 to 8.3.x and d76893e to 8.2.x. Thanks!
Adding to 8.2.x because this is just documentation.