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
We need an upgrade path from D7 for the core Book module.
Proposed Resolution
This is blocked by #2382985: Migration Files for Drupal 7 Menu & Menu Entries and #2423103: Migration Files for Drupal 7 Content.
Once those two land, this migration path needs two parts:
- Book's settings need to be moved into configuration (all set as of #6)
- Book hierarchies must be migrated -- i.e., the {book} table needs to be handled
Remaining Tasks
Update the patch to match HEADMigrate the {book} table- Write tests
- Review
- Commit!
Comment | File | Size | Author |
---|---|---|---|
#87 | interdiff-2409435-81-87.txt | 4.23 KB | phenaproxima |
#87 | 2409435-87.patch | 18.75 KB | phenaproxima |
#81 | interdiff-2409435-78-81.txt | 6.76 KB | phenaproxima |
#81 | 2409435-81.patch | 17.16 KB | phenaproxima |
#78 | 2409435-78.patch | 16.68 KB | yogeshmpawar |
Comments
Comment #1
hosef CreditAttribution: hosef commentedAttached is the YAML for this issue, from the patch in #2382117: Migration Files for Drupal 7 Variables.
Test(s) (and maybe a dump file) still need to be written.
Comment #2
miguelc303 CreditAttribution: miguelc303 at Anexus commentedAdded organization support to Anexus IT
Comment #3
jcost CreditAttribution: jcost commentedWill need to be submitted again to Core since moving from sandbox.
Comment #4
phenaproximaChanged the issue summary.
Comment #5
bdimaggioI'll get a test in for this within the next few days.
Comment #6
bdimaggioAdded a test and made a tweak to migrate.migrations.d7_books_settings.yml to account for migration_groups becoming migration_tags.
Comment #7
phenaproximaPostponing on #2382985: Migration Files for Drupal 7 Menu & Menu Entries and #2423103: Migration Files for Drupal 7 Content.
#6 is a great start, but I should have done my research before posting this issue -- because we don't only need to migrate book settings, but book hierarchies (i.e., the {book} table). Books depend on nodes and menu links being migrated first, so those need to be in before we can proceed on this.
Comment #8
phenaproximaErm -- yeah, status change. :)
Comment #9
mgiffordOk, that's in.
Comment #10
svendecabooterComment #11
svendecabooterAttached patch is my work in progress.
Still todo:
* continue updating D7 MigrateBookTest (blocked by missing helper functions in MigrateDrupal7TestBase currently)
* check if the config migration code is still correct
Comment #12
svendecabooterPostponing on #2578263: Add helper functions to MigrateDrupal7TestBase
Comment #13
KarenS CreditAttribution: KarenS at Lullabot commentedI would argue this is at least medium priority, book migrations are meaningless without the hierarchy, and book is pretty widely used (for instance on D.O.). I also don't think this is postponed on anything now.
Comment #14
KarenS CreditAttribution: KarenS at Lullabot commentedOK I guess it is still postponed on https://www.drupal.org/node/2578263.
Comment #15
KarenS CreditAttribution: KarenS at Lullabot commentedI couldn't get the previous patch to apply so I did a reroll and it worked great to migrate the book heirarchy for a D7 site with a fairly complex book structure. I don't have a D6 site to test so hopefully someone else can confirm that part. Then we just need the tests finalized.
EDIT: I finally got the original patch to apply, so the reroll may not be needed.
Comment #16
KarenS CreditAttribution: KarenS at Lullabot commentedComment #17
mgiffordComment #18
quietone CreditAttribution: quietone as a volunteer commentedComment #20
svendecabooterComment #23
DamienMcKennaNow that #2382985 and #2423103 have landed, this can be worked on again.
Comment #24
almaudoh CreditAttribution: almaudoh commentedI guess the patches here won't apply anymore.
Comment #25
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-rolled.
D7 tests are a work in progress.
Comment #26
jofitz CreditAttribution: jofitz at ComputerMinds commentedSetting back to NW for D7 tests (and probably other things too!)
Comment #27
jofitz CreditAttribution: jofitz at ComputerMinds commentedCompleted the tests for d7/MigrateBookConfigsTest, but I'm tying myself in knots with d7/MigrateBookTest so I'll leave that for someone else.
Comment #28
jofitz CreditAttribution: jofitz at ComputerMinds commentedSetting back to NW for someone (else!) to work on d7/MigrateBookTest.
Comment #30
rakesh.gectcrComment #31
jofitz CreditAttribution: jofitz at ComputerMinds commentedPatch in #27 no longer applies. Re-rolled prior to taking another run at d7/MigrateBookTest.
Comment #33
jofitz CreditAttribution: jofitz at ComputerMinds commentedWrote d7/MigrateBookTest.
Comment #35
jofitz CreditAttribution: jofitz at ComputerMinds commentedMoved new migration templates to the correct directory.
Comment #37
jofitz CreditAttribution: jofitz at ComputerMinds commentedAdded source_module to d7_book_settings.
Comment #39
srjoshComment #40
srjoshSo, that patch applies to 8.5, but doesn't work for 8.4. Here's one for 8.4.
Comment #43
jofitz CreditAttribution: jofitz at ComputerMinds commentedFix the test failures.
Comment #46
jofitz CreditAttribution: jofitz at ComputerMinds commentedRetest has passed, returning to NR.
Comment #50
srjoshHaving trouble actually using this patch. Following the migration template, I get hundreds of these errors:
That's running it stand-alone, after the migration for the book content type has been run.
Or, if I substitute 'book' as the source/destination plugin for the book content type, adding in the fields from the book migration template, that doesn't work either. I get these errors:
Missing bundle for entity type node (/var/www/build/html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:73)
How is this supposed to be used?
Comment #51
anpolimusComment #53
phenaproximaI see very little to object to here. Once these minor fixes are made, let's get this in.
plugin should be migration_lookup.
Should be "Tests the migration of Book settings."
Should be "Tests migration of book structures from Drupal 7."
Comment #54
jofitz CreditAttribution: jofitz at ComputerMinds commentedMade changes recommended by @phenaproxima in #53.
Comment #56
jofitz CreditAttribution: jofitz at ComputerMinds commentedGah! I managed to not move a couple of files.
Comment #58
jofitz CreditAttribution: jofitz at ComputerMinds commentedCorrect test failure.
Comment #59
phenaproximaWe're done here. Thanks, @Jo Fitzgerald et. al!
Comment #60
larowlansome patch noise here?
Other than that, looks good
Comment #61
jofitz CreditAttribution: jofitz at ComputerMinds commentedRemove noise.
Comment #62
heddnAnd noise is now silent.
Comment #63
alexpottMigrate API is in beta soon to be stable. I don't think we should be removing plugins because it will break existing migrations. Let's leave the old plugin in place but deprecate it and use the new plugin for both d6 and d7.
Why this change to the D6 migration and how come no test changes because of it?
Comment #64
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #65
alexpottThe menu links dependency was added in #11 without explanation. It'd be good to try and reason why.
Comment #66
heddnRe #65: It was probably added because of the comment in #7. @phenaproxima can you recall what caused you to state that?
Comment #67
heddnNeeds work to address the feedback in #65.
Comment #68
phenaproximaIt was 3+ years ago, so I can't say I remember my reasoning. I say, let's try removing the menu links dependency, and if tests fail we can add it back again and do a little more detective work.
Comment #69
jofitz CreditAttribution: jofitz at ComputerMinds commentedThe latest patch removed the menu_links dependency (and passed the tests) so are we happy for this to be RTBC?
Comment #70
heddnNice work. We're migrating the book settings and book content. We have tests. Wonderful! This would be ready. Except, this needs a partial re-roll to account for https://www.drupal.org/node/2944527
Comment #71
heddnAdding those tags seem easy enough. Tagging novice. The d6/d7_book yml files are content stuff. While d7_book_settings.yml is configuration.
Comment #72
heddnRe-titling, since we seem to be doing both d6 and d7 in the same patch.
Comment #73
heddnDoes this need a change record or any release notes mention?
Comment #74
edysmpWorking on this.
Comment #75
edysmprerolled and applied the migration tags.
Comment #77
heddnProbably a namespace thing. Check to make sure it includes the correct name to match the file system path of the class. Plus, it looks like we missed d6_book.yml as well.
Comment #78
yogeshmpawarYes @heddn its a namespace issue. adding a updated patch for this issue.
Comment #79
yogeshmpawarchanging status to Needs Review.
Comment #80
phenaproximaThanks, @Yogesh Pawar! Can you post an interdiff so we can confirm the changes?
Comment #81
phenaproximaAlright, let's try this on for size...
Comment #82
heddnHow come we cannot consolidate this down to a single migration as well? We did for the settings.
Needs a link to a CR.
can we add another test the new name too? maybe a case for data provider?
Comment #83
phenaproximaI tried, but I don't think I can do it because of the migration dependencies. The D7 version has a dependency on d7_node, and the D6 version depends on d6_node, and that's that. There's no way, really, for me to define that dynamically except with a deriver, which would negate the entire purpose of consolidating the migrations (i.e., to remove code). Optional dependencies also won't work because, for example, the D6 migration should never depend on d7_node, but it will if d7_node exists and is set as an optional dependency.
I'll address the remaining feedback tonight.
Comment #84
heddnRe #83: Good points. Perhaps a comment in the yml file would assist here then?
Comment #85
phenaproximaTagging for a change record, as mentioned in #82.
Comment #86
phenaproximaChange record written: https://www.drupal.org/node/2947487
Comment #87
phenaproximaAddressed the feedback in #82 and then some.
Comment #88
quietone CreditAttribution: quietone as a volunteer commentedChange record looks good to me.
Comment #89
quietone CreditAttribution: quietone as a volunteer commentedFound one spelling error. Hopefully that can be fixed on commit?
s/setttings/settings
Looks like everything is done here. There is a deprecation notice for d6_book, complete with a link to the correct CR, and tests for that. The reason why the dependency
- d6_menu_links
has been lost in history, and its removal hasn't caused any test failures. The new 'Content' tag has been added to both migrations.Actually there is one question not answered, #84, about whether a comment should be added to the yml files explaining why d6_book and d7_book aren't combined. I think the answer to that is that we have not been adding such comments to the migrations that are different between d6 and d7 (see aggregator) so it isn't necessary here.
Comment #90
alexpotti agree with #89's answer to #84.
Fixed on commit.
Committed and pushed b190c705bc to 8.6.x and a1d6ed6207 to 8.5.x. Thanks!
Credited people who reviewed the patch and suggested material changes.
Comment #94
quietone CreditAttribution: quietone as a volunteer commentedPublished change record