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.
Problem motivation
Follow-up to #2933620: Polish migrate.api.php API documentation.
Stubbing concept was discussed from comment #48 onwards. It was concluded in #54 that we should move the stubbing concept under its own sub heading and include also other fundamental key concepts such as rollbacks and updates / incremental migrations.
Proposed solution
Document also the other key migrate concepts.
Comment | File | Size | Author |
---|---|---|---|
#19 | 2944846-19.patch | 3.97 KB | quietone |
#19 | interdiff.txt | 1.91 KB | quietone |
#16 | 2944846-16.patch | 3.95 KB | quietone |
#16 | interdiff-14-16.txt | 825 bytes | quietone |
#14 | 2944846-14.patch | 3.79 KB | quietone |
Comments
Comment #2
masipila CreditAttribution: masipila as a volunteer commentedHere's the first patch for review. It covers the following key concepts:
Since this is documentation change only, I'm proposing that it would be cherry picked to 8.5.x.
Cheers,
Markus
Comment #3
phenaproximaMagnificent work. I only request a few minor verbiage changes, then this is good to go.
Should be 'chicken and egg'.
Let's remove 'in the map'.
'relations' should be 'relationships'.
Let's change 'content' to 'data'.
Let's rephrase this whole sentence: "For example, a timestamp property that indicates when a row of data was created or last updated would make an excellent highwater property."
'nodes' should be 'rows'; this documentation doesn't need to be Drupal-specific.
Let's rephrase: "When developing a migration, it is quite typical..."
Can this be slightly rephrased? "...undo a migration, then execute it again after adjusting it."
Comment #4
heddnThis is more typically called "Chicken or egg" in English. Ahh, I see that @phenaproxima saw the same thing.
is eventually migrated.
Loose the word "being", I think it will read smoother.Comment #5
masipila CreditAttribution: masipila as a volunteer commentedThis API doc improvement issue was left behind when things went crazy in my day job. Let's finalize this now so that we have one issue less.
This patch should address all feedback from @phenaproxima and @heddn.
Cheers,
Markus
Comment #6
heddnThere might be more than one source or destination id. So we need to account for plurality. I think this is important to document as folks get confused and think they can only use a single id. Which isn't correct, multiple are supported.
Comment #10
quietone CreditAttribution: quietone as a volunteer commentedUsing plurals as suggested in #6.
Also change a sentence in the highwater section to remove use of 'we'.
Comment #11
jibranJust one question
How can one set the current timestamp as hwm in the migration template? Maybe we can add a code example here.
Comment #12
quietone CreditAttribution: quietone as a volunteer commentedWow, that question would never occur to me! I don't think a code example is needed because the only thing the user needs to do is declare the high_water_property. I have reworded that section, hoping to emphasize that point.
Comment #13
jibranThe rewording looks good now. About the example, I had to refresh my memory about hwm usage by reading
\Drupal\Tests\migrate\Kernel\HighWaterTest
andhigh_water_test.yml
. :DI think we can say something like, e.g. for D7 node migration 'changed' source property can be used to set up the highwater mark
Comment #14
quietone CreditAttribution: quietone as a volunteer commentedExample added.
Comment #15
jibranWithout the source plugin 'd7_node' 'changed' is missing the context here.
How about
In this example, the row property 'changed' is the high_water_property. The row property 'changed' contains the last updated timestamp for each row which will be used to setup highwater mark.
or something along these lines.
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedThanks. I did try something like that extra explanation but failed (have a headache which is distracting) but I could work with your suggestions and do something useful.
Comment #17
jibranThank you for updating the patch. It looks good now.
Comment #18
jhodgdon@jibran asked me to review this patch for wording/clarity/proofreading. I think it is looking great! It is very clear and it seems like a great addition to the documentation.
Here are 4 very small suggestions:
a)
The Drupal project uses serial commas: like "apples, oranges, and bananas" (comma before "and"). So there needs to be a comma after "IDs" in this line.
b) next line down:
For that sentence, how about "facilitate" instead of "allow"?
c)
Suggest putting "of" before that last word "changed".
d)
Maybe instead of the word "scenarios" here, substitute something like "migrated data"?
Comment #19
quietone CreditAttribution: quietone as a volunteer commented@jhodgdon, thanks for taking the time to review this.
Credit goes to masipila, who made great documentation contributions to Migrate.
#18 a, b, c, and d) Fixed as suggested. For d) I wondered if it should be 'source data' instead of 'migrated data'. In the end I decided that either get the meaning across so used the suggestion by the more experienced writer.
Comment #20
jhodgdonThanks! I will not mark it RTBC since I am not sure about the technical correctness, but to me it looks great.
Comment #21
jibranThank you @jhodgdon for the review. Yeah, the patch is ready IMO.
Comment #22
quietone CreditAttribution: quietone as a volunteer commented@jibran and @jhodgdon, thanks for the quick reviews. Feels good to get a 3 years old issue to RTBC in two days.
Comment #24
quietone CreditAttribution: quietone as a volunteer commentedRandom test failure, on Media_library.Drupal\Tests\media_library\FunctionalJavascript\WidgetUploadTest #3066447: [random test failure] Random failures building media library form after uploading image (WidgetUploadTest)
Setting back to RTBC
Comment #25
MatroskeenGreat job here! I really like documentation improvements, especially for migrate API.
I checked the proposed changes via Grammarly and it suggested replacing "When a term is being migrated, it is possible that its parent term has not yet been migrated." with something more simple. Can it be something like "When a term is being migrated, its parent term can be not migrated yet."?
Comment #26
jhodgdonThat suggestion changes the meaning of the sentence and it wouldn't make any sense at all with the remaining text, so I think we need to leave it as it is.
Comment #29
catchGood improvements.
Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!