Problem/Motivation
The UI review page report lists the field modules in the missing paths, even though fields are migrated. Find a way to have have them listed in the available migration paths section.
Steps to Reproduce
- Fresh, clean install of Drupal 8
- Have a D6 or D7 database available
- Install migrate drupal UI, migrate drupal and migrate.
- Navigate to /upgrade
- Click 'confrm'
- Select the db version of the source, enter the db credentials for the source. The file source can be left blank
- Click 'review upgrade'
- The Upgrade analysis report is now displayed
This issue is about the module names displayed in the 'Missing upgrade paths' section.
The missing paths shown on the form are the modules that do not have any migrations. Some of those will be modules that will never need a migration path, such as Help, and others are from the field migrations. This issue is to fix the field migrations so that, when a field migration exists, the respective modules are listed in the 'available upgrade' path section not the 'missing path' section. The other case is being handled in a child issue.
original report
When I start the migration process in the UI from /update, I am warned about a bunch of things that Migrate doesn't think it can handle. It seems to be a list of modules that it doesn't know about.
Some of the field modules that should be in the available table:
- date
- entityreference
- field_sql_storage
- link
- list
- number
- options
- phone
These, at least, are definitely handled by Migrate. I should not be warned that these cannot be migrated. It creates unnecessary alarm.
Before

After

Proposed resolution
Modify the field plugin annotations to include source_module and destination module (#11).
And some extra tasks came up:
- New test method, testFieldProvidersExist(), added to assert the new annotations
- Assertions on the review page output added to testMigrateUpgrade
- Change record added
- Handle modules that will never have a migration path. #2914974: Migrate UI - handle sources that do not need an upgrade
- Follow up created:
Remaining tasks
Review
Commit
User interface changes
The migrate UI review page.
API changes
New required annotations on migratefield plugins (BC Break)
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #135 | after.png | 139.68 KB | maxocub |
| #135 | before.png | 132.02 KB | maxocub |
| #119 | interdiff-2859304-116-119.txt | 1.66 KB | maxocub |
| #119 | 2859304-119.patch | 40.2 KB | maxocub |
| #116 | 2859304-116.patch | 40.5 KB | quietone |
Comments
Comment #2
quietone commentedComment #3
quietone commentedComment #5
heddnI think a lot of this could/would be fixed in #2905227: Migrate UI: Improve 'Review Upgrade' page UX. Shall we repurpose this to fix some of the errors where we are obviously migrating things like link and date and telephone? Now that the static mapping array is gone, we should fix this up to show that some of these obvious things *are* getting migrated.
Comment #6
heddnReviewed this in our weekly migrate call and are upgrading this to a migrate critical.
Comment #7
heddnComing from #2905741: *DRAFT* Proposed product goals for Drupal 8.5/8.6(+) core
- field_collection => paragraphs, paths exist with a custom migration
- addressfield => address, paths exist with a custom migration
- phone => in core and fixable with this issue
- name => ???
- entity =>in core and fixable with this issue
- book => in core and fixable with this issue
- entityreference => in core and fixable with this issue
- node_reference ( (=> entityreference) => in core and fixable with this issue
- nodequeue (=> entityqueue) => ???
- statistics => in core and fixable with this issue
- uuid => parts in core, what do we need to migrate???
- xbbcode => ???
- xmlsitemap => xmlsitemap, paths exist with a custom migration
Comment #8
rivimeyheddn, thanks for the summary. New issue is #2906878: [Meta] Support for D7 -> D9 contrib migrate
- "name" is https://www.drupal.org/project/name and there is a D8 port, beta1, though from Jul 2016.
- xbbcode is an upgrade/replacement for the earlier bbcode filter module. Mostly the need is to port the config so that the site content is filtered properly.
could you elaborate on 'with a custom migration'?
Comment #9
heddncustom migration: https://www.drupal.org/project/migrate_tools and https://www.drupal.org/project/migrate_upgrade where you export the config, add in your own custom process plugins and run the migration using drush.
Comment #10
jhodgdonJust to be clear, when I filed this it was a D6 to D8 migration, not D7 to D8. I haven't tried a D7-8 migration.
Comment #11
heddnI think we need to add to the field plugins an annotation that mentions what is the source module, then loop over the fields and add those field modules to the list of enabled modules
Comment #12
quietone commentedInteresting idea. I need to think about that a bit. There is still a need to resolve modules like 'ctools' and 'field_ui' and 'field_sql_storage'. Which can be done in a static array.
Comment #13
quietone commentedThis is rough, it is exploring the idea of adding annotations to the field plugins in #11. In the screen shot, link is not enabled on the destination, so it is correctly listed as 'Missing'. So, it looks good. However, 'Options' and 'Numbers' should probably not be listed as missing. That requires more work.
I also changed the source module for d7_field to field_sql_storage.
Comment #14
quietone commentedSet to NR for the testbot.
Comment #16
quietone commentedHopefully, fixing the errors. Just typos in two files.
Comment #17
quietone commentedA bit of cleanup. Inject the migrate field plugin manager interface and the module handler. Add the field migrations to the table_data array and remove unused code.
Comment #18
heddnSome stray stuff seems to be in the last few patches.
Comment #19
heddnThe patch wouldn't apply with the stray setting tray and rest changes. Here's a re-roll without it.
Comment #20
heddnHere's a different approach, since the previous one had issues with finding all the field types. I manually ran a d6 and d7 migration through the UI and caught some missing/incorrect mappings. Next we need to do some asserts on the review page to confirm we have all the right things mapped correctly. That should be a fairly good novice test task, so tagging. Hint, add the asserts to MigrateUpgradeTestBase around line ~150.
Comment #21
heddnAnd here's the patches that were missing from #20.
Comment #22
heddnAny chance we can trigger an errror or throw an exception if these are missing from the field plugin? I'd like to throw an exception, but that could break BC. So trigger_warning is probably a better option.
Comment #25
quietone commented@heddn, sorry for the extraneous stuff in the patch. It is 'interesting' getting time to work on an issue while on holiday.
We can copy the existing method used for informing the user, which is a drupal_set_message.
Comment #26
heddnI kinda prefer trigger_error, personally. It seems more php-ish and a little louder and would get caught in contrib module testing.
Comment #27
quietone commentedThis should fix the errors.
Still to do:
1) If we are adding 'providers' to the field plugins, then we need to test that they exist. That can be done in MigrationProvidersExistTest.php. This is a new item, unless someone thinks this should not be done.
2) Add assertions for the output on the review page to confirm the modules are correctly listed in either the available or the missing migrations. This is from #20.
3) Use trigger_error if the migration or the field plugin does not have a source_module and destination_module. This is from #22.
Comment #28
heddnFor the question about trigger_error vs throw exception, I've opened #2908282: Throw exception for source plugins without a source_module property. And moving back to NW for tests. And tagging for a CR to mention the new requirement for field plugins.
Comment #29
quietone commentedTotally agree with the new issue. Thanks
Comment #30
heddnI've picked up 27.3 here. And it is an exception per #2908282: Throw exception for source plugins without a source_module property.
Comment #31
heddn'id' is caught in the parent. No need to duplicate it in the child.
Comment #34
heddnSo, cckfield plugin manager was extending field plugin manager. I've split that out so it extends directly from the base migrate plugin manager and we don't require source/destination then any more for legacy cck field plugins. There's bound to be a few failures/missing source/destinations. Adding this should be novice.
Comment #35
heddnComment #37
heddnComment #39
jofitzAdded to D6FileField the same source_module and destination_module as D6NoCoreVersionSpecified.
Comment #40
heddnBack to NW for #27.
Comment #41
Bojhan commentedCan we "group them" and just say 27 missing modules, and then the user can opt into looking at them?
Comment #42
jhodgdonLots of patches! If someone posts a patch that they think is actually viable or close to done, let me know and I can test on the site that caused me to file this issue. For now I'm assuming the patches are iterations, not done, etc.
Comment #43
quietone commented@Bojhan, the work to redesign the review page is being done in #2905227: Migrate UI: Improve 'Review Upgrade' page UX.
Comment #44
xjmPer discussion with @catch, we're promoting the "Migrate critical" issues to critical given the importance of a stable migration path at this point in the release cycle. (The framework and release managers will confirm this in a later triage for individual issues.) Thanks @quietone and all!
I made basically the same remarks as #41 but @Gábor Hojtsy clarified that this issue will just be removing irrelevant/incorrect messages entirely while the redesign happens in
Comment #45
xjmMissed actually promoting it in #44.
Comment #46
quietone commentedRerolled the patch because ti did not apply.
Comment #47
quietone commentedPostponing on #2908282: Throw exception for source plugins without a source_module property because both are changing the destination_module annotations.
Comment #48
heddnThey are changing the destination and source modules, but they are doing it on different things. This is doing it on field plugins and the other issue is working on source, destination and process plugins. Un-postponing.
Comment #49
heddnTagging for sprinting.
Comment #50
jofitzI've lost track - what further work does this need? What still needs tests (or is that tag out of date)?
Comment #51
heddnWorking on what is needed. Patch coming.
Comment #52
quietone commented@Jo Fitzgerald, good question.
From #27 till to do:
1) If we are adding 'providers' to the field plugins, then we need to test that they exist. That can be done in MigrationProvidersExistTest.php. This is a new item, unless someone thinks this should not be done.
2) Add assertions for the output on the review page to confirm the modules are correctly listed in either the available or the missing migrations. This is from #20.
3) Use trigger_error if the migration or the field plugin does not have a source_module and destination_module. This is from #22.
heddn, worked on #3 but I am not yet sure if it has been fixed. Just wanted to answer your question.
But it looks like heddn is on it
Comment #53
heddnRemaining task:
This picks up test coverage, mainly.
Comment #54
heddnThis seems out of place. How did this get into the patch?
Comment #55
heddnAlso, after looking at what we are doing in #2908282-41: Throw exception for source plugins without a source_module property, do we need to do similarly for field plugins and assume the provider is the destination module if no annotation is provided?
Comment #56
quietone commented@heddn, The change to ImageField was made in #21. Your comment about it in the previous comment you "manually ran a d6 and d7 migration through the UI and caught some missing/incorrect mappings".
The assertion are covering the fields. Should we have another issue for covering the others instances of source_module and destination_module in the same way, that is, checking the values, not existance?
Comment #57
quietone commentedFound a spacing issue.
Out of alignment.
I tried to test the review page output but wasn't able to. We can't just assertText (which I now) because the output is a big table and we need to know what column it is in. Can someone provide some direction?
Comment #58
rivimeyI have a D7 site which I tried to upgrade on a current 8.4.x D8 with patch #52 installed. The attached text file indicates the "errors" I got as a result.
I have passed a copy of the D7 SQL to @quietone as requested so that she is able to check further but this DB is not publishable on the net.
D8 site prepared with:
Comment #59
quietone commentedRan a test with the database given to me in #58 using the following steps.
The results:
Not sure what is causing the errors yet, but seems like a suitable problem for the 30 hour journey home. Therefore assigning to myself.
Note that with the D7 test fixture, the results are correct.
Comment #60
rivimey@quietone thanks :)
Comment #61
quietone commentedThe next time I booted up (after several hours of traveling) and navigated to /upgrade, the errors did not appear. I recall that I did a 'drush cr' and had navigated to /upgrade and entered the details for the D7 test fixture, which didn't produce errors, before shutting down. Admittedly it is all a bit fuzzy due to the demands of travel. So, right now, it seems that a cache clear is needed. But I have not retested that.
But I did update the patch.
Changed how source_module and destination_module are obtained in the migrate_drupal_ui form. Before, the destination site was searched for all available field types, then the field plugin was obtained by the type. This is wrong because the input parameter to getPluginIdFromFieldType is the field_type from the source database, not the destination.
Added two new methods MigrateFieldPluginManager::getSourceModule() and MigrateFieldPluginManager::getDestinationModule().
There are 3 todo items in #52. If those #1 is done. I think #2, testing the output of the review page itself, isn't necessary. The data to be displayed is tested, there hasn't been a response to how to test that output table, and that page is being redesigned in #2905227: Migrate UI: Improve 'Review Upgrade' page UX.
That leaves #52.3 todo.
Comment #63
quietone commentedNeed to add source_module and destination_module on the cck field plugins.
Comment #65
quietone commentedMissed a few cck field plugins.
Comment #66
maxocub commentedAssigning for review.
Comment #67
quietone commentedDid some code cleanup and added a draft change record.
Comment #68
heddn#52.3 is done. We throw an exception during plugin discovery if any plugin is missing the annotation.
Comment #69
maxocub commentedI like the idea of removing those confusing missing field migration paths.
Why is there no destination_module here? Are the tests suficient if this didn't make them fail?Edited: Oh, this is not a field plugin, but a source plugin.Duplicate source_module & destination_module
Why was this file copied? The two files looks almost identical. Can one of them extends the other?
Nit: unecessary comma addition
White space typo
Nit: unecessay space between curly brackets
Could we make those two descriptions match?
Copy/paste error
unecessary quotes around $version
If the 'core' property is required, should we remove the empty array as the default value of this property?
Indent typo
I don't understand why this is added, it's identical to the parent class.
Comment #70
quietone commentedThis should fix all the items above. About #2, the file was copied way back in #21, it now extends from FileField as you suggested.
Edit: This only addresses #1-9 above.
Comment #72
quietone commentedStray character caused the test failure.
10. Reasonable. The default value has been removed. But the MigrateFieldPluginManager set a default of 6. Maybe the default should be 6 in the Annotation?
11. Fixed
12. Fixed
Comment #73
maxocub commentedI tested this both with the Drupal 7 fixtures and with fresh empty Drupal 7 install.
1. With the fixtures:
Optionsstill shows up in the missing paths when it's clearly enabled on both the source and the destination. Any idea why?2. With a fresh install:
Options,NumberandListstill show up in the missing paths. Those modules are enabled on both the source and the destination.3. Should this issue also deals with missing paths that will never have a path? Like
Help,Overlay,Toolbar, etc.Comment #74
maxocub commentedOups, removed the tag by mistake. I will try to see if and how it would be possible to assert text on the missing paths table on the review page.
Comment #75
quietone commented@maxocub, thanks for the review and the testing
1. Don't know yet.
2. When I tested with a fresh install I only had 'options' as a missing path.
3. I'd rather have a follow up for that and keep this strictly or fields.
Setting to NW.
Comment #76
maxocub commentedSince this issue is for the UI, I think we should add assertions about the missing/available paths in MigrateUpgradeTestBase. I found a way to do that with xpath:
Examples
$this->assertSession()->elementNotExists('xpath', '//table[@id="edit-missing-module-list"]//td[text()="options"]');$this->assertSession()->elementExists('xpath', '//table[@id="edit-available-module-list-module-list"]//td[text()="node"]');Comment #77
maxocub commentedCross post, back to NW.
Re #75: I agree with 3.
Comment #78
quietone commented73.1.Options wasn't found because only those field plugins that matched a type in the source were looked at. And since options isn't a field type it wasn't found. So, ditched the code getting the field plugin source and destination module information and started over. This version gets the information from the plugin in much the same way as is done for the migration and adds it to the big array. Much simpler too. This fixes the problem with options still showing up, it no longer does.
73.2. Haven't retested on a fresh install.
@maxocub, awesome that you found a way to test with xpath. I never even thought of that. I might get time to try later tonight when the little one is aslepp.
Todo:
Make a followup for missing paths that will never have a path? Like Help, Overlay, Toolbar, etc.
Comment #79
quietone commentedImplemented the suggestion in #76 for testing the output. The arrays for available and missing need to be more thoroughly checked. And the tests for a missing path fails, and I don't know why.
This test fails:
$this->assertSession()->elementExists('xpath', '//table[@id="edit-missing-module-list"]//td[text()="' . $missing . '"]');And these are probably false positives:
$this->assertSession()->elementNotExists('xpath', '//table[@id="edit-missing-module-list"]//td[text()="' . $available . '"]');Comment #80
quietone commentedMade the follow up, #2914974: Migrate UI - handle sources that do not need an upgrade.
Comment #82
maxocub commentedI like that we can now test all the missing/available paths!
I think the tests are failing at the first wrong assertion, so there were no false positive, only paths in the wrong array.
Take a look at this interdiff, I think it will make everything green.
Also, there's a few coding standard messages to be corrected.
Comment #83
quietone commented@maxocub, thanks for showing me the error of my ways. MigrateUpgrade6Test passed locally so, hopefully, the edits to the D7 test are OK too. Not sure I got all the reported coding standard errors fixed though, what appears to be a link on the test result page isn't really a link.
Comment #84
quietone commentedRemove unused use statement.
Comment #86
quietone commentedWrong patch. Try this one.
Comment #87
quietone commentedUpdate the IS.
Comment #88
quietone commentedComment #89
phenaproximaI don't know if this is necessary. Couldn't we simply implement an alter hook to create this plugin definition dynamically, rather than define an empty class whose only purpose is to carry an annotation?
I don't see why this is necessary. The foreach is looping over $definitions, which means every item in there will be dealt with.
$definitions should be type hinted.
Rather than pass in a $missing_property value, can the data provider simply provide the full, expected exception message, and the test can assert that? It will be easier to understand.
Nit: This should be
'core' => [6, 7]. The explicit numeric indices make it hard to read.Should be
'core' => [6, 7]for readability.Why is this no longer defaulted to an array?
This doesn't seem accurate. The field plugin is not determining how the value is used. This annotation is a Migrate Drupal-specific annotation, and $source_module (and $destination_module) should always refer to Drupal modules. So can we fix both doc comments to reflect that?
Doesn't this step on the toes of #2908282: Throw exception for source plugins without a source_module property?
processDefinition() throws an exception if source_module and destination_module are not defined in the plugin definition. Therefore, we can assume that $definition['source_module'] and $definition['destination_module'] are always set. So I'm not sure this method, or getDestinationModule(), is really needed.
The exception thrown in processDefinition() guarantees that we will never hit this condition.
The exception thrown by processDefinition() guarantees that we will never hit this condition either.
Therefore, this if check is not necessary.
Can this be explained a little more?
@return docs are inaccurate.
If possible, let's define this dynamically in an alter hook in the Options module, rather than create an empty class just to support an annotation.
Same here.
Comment #90
quietone commentedThis issue is making it possible for modules providing fields to be accurately shown in the available or missing line. So changing the title
Comment #91
quietone commented89.1, 16, 17. Sure we could use an alter hook but, I think, it makes it harder to find the annotation and the code to alter the hook is a bit harder to maintain than the explicit declaration in the annotation. Now, one way to find the field plugins is to just 'grep '@migratefield'. If this change were added one would also have to grep for all alter hooks and read them.
And there is precedence, maxocub pointed out on IRC that in #2901851: Replace the static map in the d7_field migration by field plugins classes are created that only provide the annotation for @MigrateField.
So, all together, doing this seems like extra work to find the field plugins. And I'd rather not.
2. Fixed.
3. Fixed.
4. Sure but, I think it would be harder to read. Why? Because I have to scan the whole string each time to see what the missing property is. As it is now, the data provider tells me exactly what property is being tested. And why copy/past the string 3 times when 1 version of it will do?
5. Fixed
6. Fixed
7. No longer default to array becuase it is now a required property (#69.10) But questioned if it should be set to 6. (#72.10).
8. Comments updated.
89.9. Possibly steps on the toes of #2908282: Throw exception for source plugins without a source_module property but that issue is at NW and the last comment states that it needs a rethink. Because of that let's keep this and the other issue can tidy up.
10. Removed the if statements. Kept getSourceModule and getDestinationModule, although I'm not convinced it is all that helpful.
11. Fixed
12. Fixed
13. Fixed
14. Not sure about this one. It was added by heddn in #20. Maybe he can comment.
15. Fixed
16. See #1 above
17. See #1 above
And some coding standard fixes.
Comment #92
rivimeyFWIW, I 100% agree with @quietone in "89.1, 16, 17. Sure we could use..." as it seems far easier and less likely to break to have one single pattern: define a class deriving from X with an annotation -- than patterns using hooks as well.
Employ the "principle of least surprise"...
Comment #93
heddnReviewed in weekly migrate maintainers. Get rid of the getter on source/destination module. Adam will add some other comments.
Comment #94
phenaproximaDiscussed in the Migrate maintainer call this week, and we agreed on a few things:
@quietone agreed to fix these issues, so I'm assigning this issue to her. Once these are done, I'm pretty sure we are either at RTBC, or close to it.
Comment #95
quietone commentedThere are two things left to do
1) Remove getSourceModule() and getDestinationModule() from FiedPluginManager and Interface. Done.
2) Don't think this does what was asked. $system_data has already been manipulated such that the type, module and theme, are keys. I just moved the foreach loop to just after getting the system_data from the form_state.
Comment #96
quietone commentedForgot to modify the ProvidersExist test file.
Comment #98
heddnI'll review this in the next few days.
Comment #99
maxocub commentedThis doesn't seem to be working, I still see "standard" in the missing upgrade paths. I think there's a "module" sub-array in the $system_data array.
Also, we should try to do what @phenaproxima suggested in #94, that is to dynamicaly check if it's a profile by using system_get_info() (I have not found any function called system_get_module_data()) and check if the type is "profile".
Comment #100
quietone commented'Standard' no longer appears.
As for the other point. I don't see the point of using system_get_info. Besides, how does one use that method on the source db? Anyway, please enlighten me.
Comment #101
phenaproximaOh, this looks good. Definitely very close.
The entity_reference module, as I understand it, is a shell module that will be gone in Drupal 9. Entity reference fields and functionality are completely merged into core. So I think the destination module could be 'core', no?
For easier debugging, maybe we should also add
$this->assertArrayHasKey($key, $expected_mappings);in the foreach loop?Why do we need to mock both getDiscovery() and getDefinitions()? Surely all we need to do is mock getDefinitions()??
If there is a reason we need to mock both, can we have a comment explaining why?
Nit: @return is missing a description.
Nit: "installed and enabled" is redundant. Can we just say "installed"?
Same here.
If we want to get fancy, we could create a new type of exception, extending InvalidPluginDefinitionException, which builds the message string in its constructor. That way we can throw these exceptions more easily:
throw new BadPluginDefinitionException($plugin_id, $missing_property)That's just a suggestion, though. Definitely not a big deal!
We should really open a follow-up (major, not critical) to allow dynamic discovery of profiles. Because as soon as a distro or custom profile enters the picture, this won't work.
Let's call $this->assertSession() once and re-use the return value.
@return should be "An array...", not "And".
Same here.
The abstract method is protected, so this should be as well.
Same here.
And here.
And here too.
Comment #102
quietone commentedThis should fix 101-2, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15.
1. There are more references to entity_reference, just don't have the time right now.
3. Can someone else do this one? Still not confident with all the mocking ...
7. Conceptually like the idea of making it easier to send useful error messages.
8. 'Because as soon as a distro or custom profile enters the picture, this won't work. ' Now I get it. Sometimes I don't see the forest for the trees. Agree with a follow up.
Haven't had time to test, fingers crossed.
Comment #103
quietone commentedBack to needs work for #101 - 1,3,7, and 8
Comment #104
phenaproximaTagging to we remember to create a follow-up for distro/custom profile support.
Comment #105
jofitzI have addressed #101-3 by renaming the variable names of the 2 mocks and adding a couple of line breaks to distinguish them. I couldn't find a way to phrase a comment or two that could explain things in code, but here are my ramblings in case someone can do better:
The
$plugin_managerhas a single mocked method,getDiscovery(), that, when called withinfindDefinitions()(which is called withingetDefinitions()) returns the$discovery. The$discoveryhas a single mocked method,getDefinitions()which is also called withinfindDefinitions()and returns the data-provider-specified$definitions.$definitionsis looped over andprocessDefinition()is called which throws the expected exception.We can't simply mock
getDefinitions()on$plugin_managerbecause we are testing whether one of the methods it contains is functioning correctly.I hope that helps...
Comment #106
jofitzBack to Needs Work for #101 - 1 ,7, and 8
Comment #107
jofitzI have addressed the remaining points from #101:
1. Removed the 3 references to entity_reference as a destination_module (userreference, nodereference & taxonomy_term_reference).
7. Added BadPluginDefinitionException.
8. Created a follow-up ticket - #2918185: Don't display install profiles in the Migrate UI.
Comment #108
phenaproximaOops, sorry! Just couple of concerns about the new exception. Other than that, this patch is music to my eyeballs.
I think we should not put this in the plugin component, because it will be more controversial that way. Let's move this into Migrate's namespace as a Migrate-specific variant of InvalidPluginDefinitionException. So we can do something like this:
We don't need this as a parameter. We can just reuse $plugin_id.
Comment #109
phenaproximaRemoving the "needs followup" tag, now that #2918185: Don't display install profiles in the Migrate UI is filed.
Comment #110
jofitzMade the corrections to the new Exception.
Comment #111
phenaproximaI think this looks good.
Comment #112
jhodgdonSince I was the original reporter of this issue, I decided to test it manually using the same D6 source site I used before. Here's what I did:
a) I had downloaded the latest drupal 8.5.x dev tgz file from drupal.org (easier than git for me for Drupal core at the moment) on October 17 when I tested #2886609-12: Migrate translations for D6 i18n taxonomy 'localized' terms, so I used that and unpatched the two files from that issue, and also wiped out the database from that previous test, and emptied the sites/default/files directory.
b) Applied this patch using the patch command.
c) Installed Drupal in this site from UI, using the Minimal install profile, configured site without Update module.
d) Turned on Seven/Bartik themes, and a bunch of core modules: Migrate, Migrate Drupal *UI, Migrate Drupal UI; all 4 multilingual modules; Toolbar; plus some my migrated d6 site would need: Taxonomy, Views, a bunch of field modules, Image, File, custom blocks and custom menu items.
e) Went to /upgrade, clicked Continue, entered the site database/files information, clicked "Review upgrade" button.
So, I don't think this is completely working. I am still getting a bunch of missing module listings that I think are incorrect. Note: My original issue title wasn't about field type modules specifically, but about the whole list of supposedly missing migrations. Someone changed the title a while back without filing another issue to cover the original scope.
Anyway, here's the "missing" list -- I have put a *** by modules that I think should be covered by Core modules that I have enabled, and ??? by ones that I'm not sure about:
admin_menu Missing
backup_migrate Missing
captcha Missing
context Missing
context_ui Missing
ctools Missing
*** date_api Missing
*** date_timezone Missing
fieldgroup Missing
*** i18nblocks Missing
*** i18ncck Missing
??? i18nstrings Missing
??? i18nsync Missing
*** i18nviews Missing
*** imageapi Missing
*** imageapi_gd Missing
*** imagecache_ui Missing
lost_character_captcha Missing
math_captcha Missing
menu_block Missing
menutrails Missing
*** nodereference Missing
nodewords Missing
nodewords_basic Missing
path_redirect Missing
pathfilter Missing
rules Missing
rules_admin Missing
token Missing
update Missing [Note: I didn't have this module on in my destination site]
*** views Missing
views_data_export Missing
*** views_ui Missing
If some of these are not in scope for this renamed issue, then we need a new issue or issues to cover them.
Comment #113
phenaproximaThere is a critical issue already open, blocked on this one, to handle the core modules that have no upgrade path: #2914974: Migrate UI - handle sources that do not need an upgrade. Once that lands, a separate one, quite possibly critical as well, will be opened for contrib.
Comment #115
phenaproxima*sigh*
OK, Drupal CI, you're the boss.
Comment #116
quietone commentedReroll.
Comment #117
quietone commentedOh yea, NR for the testbot
Comment #119
maxocub commentedSorry, my bad, the structure of the "review upgrade" page was changed in #2905227: Migrate UI: Improve 'Review Upgrade' page UX so the xpath assertions didn't pass anymore.
Comment #120
jhodgdonPlease look again at #112. It includes Views, for instance -- how is it possibly correct to be included in the list? I definitely had both the Views and Views UI modules enabled in my D8 testing site.
And what about Date and Date API? And Nodereference?
Comment #121
heddnre #120: that will be handled in #2914974: Migrate UI - handle sources that do not need an upgrade.
However, there is no upgrade path for views. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-d... & https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-d... for more details.
Date will also get addressed in that follow-up.
Comment #122
phenaproximaDate is handled in this patch. Date API, on the other hand, is not. And rightfully so: date fields are already properly migrated and have been for some time; Date API, in and of itself, will have no upgrade path.
It's counterproductive to look at this issue separately from #2914974: Migrate UI - handle sources that do not need an upgrade. They are really two sides of the same coin; we are dealing with it in multiple issues so that this one doesn't become an overlong, overcomplicated patchzilla. The scope of this issue is for field migrations. Once #2914974: Migrate UI - handle sources that do not need an upgrade is done, the UI will be a great deal clearer about which upgrade paths are actually missing.
Full steam ahead.
Comment #123
phenaproximaI'm copying @jhodgdon's list of modules from #120 into #2914974: Migrate UI - handle sources that do not need an upgrade because I think it will be helpful to determine an initial list of modules which should be marked as having no upgrade path.
Comment #124
jhodgdonGreat, thanks for the clarification! Just wanted to make sure everything was "issueized". I will follow that other issue and volunteer to test it when a patch comes through.
Comment #125
gábor hojtsyIt is unfortunately impossible to tell with the issue summary how does this improve the UI which would be important on a UX issue :) Maybe steps to reproduce if they are relatively easy if a static screenshot would not do.
Also the change notice draft says "Migrate field plugins now require source_module and destination_module" -- how are we going about the backwards compatibility of this on the API? (And if there is backwards compatibility, why is it required -- is it strongly suggested instead?)
Comment #126
quietone commentedAdded steps to reproduce.
Comment #127
quietone commenteds/step/steps/
Comment #128
quietone commentedComment #129
quietone commentedThe previous comment should have that I added an bit more clarification that this issue is solving the field migration part of the problem.
And fixed formatting
Comment #130
heddnIS is updated.
re #125: it is an intentional BC break for field plugins. We discussed part of our decision over in #2908282: Throw exception for source plugins without a source_module property in the very early comments. This change also in migrate_drupal, which is still in alpha so BC *is* possible, although we have tried to avoid it as much as we can.
Comment #131
quietone commentedDiscussed at migrate meeting and we agree this is ready to review.
Comment #132
maxocub commentedI'm gonna go ahead and put this back to RTBC since both questions in #125 have been answered.
Comment #133
webchickI'm still really missing a "before/after" here. I don't see it in the issue summary, only the description of the original problem.
Comment #134
maxocub commentedHere's some before/after screenshots!
Before
After
Edited: new screenshots.
Comment #135
maxocub commentedMy previous screenshots were not clearly showing the improvments, here are new ones. (I edited my previous comment to display these new screenshots)
Comment #136
rivimey@maxocub, many thanks for clarifying the screenshots.
I agree that there are some really good steps forward here, but I would also like to point out that from the 'after' image, I would expect that these modules:
- entity
- book
- blog
.. could have content, not just configuration, and so their 'missing' state should be explained in the UI.
I also believe there is a need for some architectural developer documentation in this area - as I noted in an earlier post I found the current migrate difficult to understand. Would it be appropriate to add "Needs documentation"?
For a possible new Issue, I have been wondering whether there is a need for a part of Migrate to:
- provide suggestions of which D8 modules should be downloaded & enabled so that they can migrate the existing content;
- optionally, use a 'drush pm-download' type tool to get them;
- for modules that are known to be config only, this could be explained in the UI, and others could be reported as 'No information' rather than the rather inscrutable 'Missing'
- list configuration associated with the original D6/7 modules to make a sort of 'report' which could be saved for later reference.
I was pondering adding something to a new migrate-related module -- migrate_suggestions? -- that could be extended with this metadata for those modules known to support D2D migrations. Should I create such an issue?
Comment #137
quietone commented@rivimey,thanks!
I will try to address the item in #136 in order.
1. Currently there is no way to know if a migration is for content or configuration. So we can only inform that isn't a migration path for the module. See #2711099: Categorize migrations according to their type.
2. If you want more documentation about this form to appear in the, MigrateUpgradeForm api documentation then, I think, Needs Documentation tag is the one to use. Otherwise is this something for the Upgrade to Drupal 8 section? If so, then a new issue for that would be helpful, tagged 'd.o documentation'.
3. We don't have the information to provide suggestions for what contrib module to download. We will know that the source db installed some module 'XYZZY' but we do not know what the D8 equivalent is.
4. As with #1, migrate doesn't know if a migration is for content of configuration. Yes,'Missing' is accurate and a long way to say 'no migration found'. Since this issue is about fields and I don't see an issue addressing that wording will you please make one.
5. This would be a Feature Request. What is the purpose of such a report?
6. Making an issue would get more eyes on the ideas and provide more feedback.
Comment #138
rivimey@quietone,
Regarding the docs issue, I suspect there are two aspects; the more detailed API-level aspects that will enable a module maintainer to implement a suitable migration path, and the site-builder level which will assist in identifying how to effectively use the migration ecosystem, diagnose and address issues found.
Consequently I have marked up Needs doc here (for the module maintainer who wishes to update or implement a migration path) here. I will add the other as well.
I will also add an issue around UI wording et al.
Regarding the report, I was thinking of it as a way for site-builder level devs to gain a summary of the config of the existing site, to assist in setting up D8 appropriately. For example, it might well contain api keys, URLs and more for external services which still need to be included. In real terms, it is likely to be a listing of the variables table, but it would be nice to be able to put some structure around it too.
For the report and for the config/content split, I know that migrate cannot by itself know whether a module is one or both at present, and in any case if the module isn't installed on the D8 site it can't be asked. So the 'suggestions' module would essentially have to be a store of metadata about those modules people care enough about to record in it.
... I will make an issue for that, too :-)
Comment #139
rivimeyJust seen there is a recently-completed issue that should cover the document migrate-for-module-maintainers issue:
https://www.drupal.org/node/2610062#comment-12307159
with the docs here:
https://www.drupal.org/docs/8/api/migrate-api/writing-migrations-for-con...
Is this (still) correct and complete?
Comment #140
rivimeyI have created #2919565: Migrate: add "suggestions" module to assist D2D migrations to discuss the metadata/suggestions module idea.
Comment #141
quietone commentedThanks for the clarification. Your points are valid and the documentation is being worked on and they are also beyond the scope of this issue. There is an existing issue for improving documentation for module maintainers, #2914500: Add documentation for writing custom/contrib modules. And there are quite a few api documentation issues still being worked on. Because of the scope issue and, I think, there are existing documentation issue covering this I am removing the Needs Documentation tag.
Oh, the Meta for the documentation issues is #2561243: [meta] Migration system documentation
This is the latest version. I can't confirm it is complete. But the issue for that page is #2610062: Document implementing migration paths for contrib modules
I think that covers everything.
Comment #142
quietone commentedNow I am really updating the tags. Removing needs documentation and adding blocker.
This is blocking a Critical #2914974: Migrate UI - handle sources that do not need an upgrade.
Comment #143
maxocub commentedThis is also blocking a second Critical #2908282: Throw exception for source plugins without a source_module property.
So +1 for the blocker tag.
Comment #145
gábor hojtsyAfter reviewing the changes carefully, it is apparent that any BC breaking changes are made to alpha modules within the migrate modules. While we try to avoid BC breaks even though they are technically alpha and that would allow BC breaks, this does not seem to be possible otherwise as we need the metadata about the plugins as well as the management of that data to happen.
While this does not solve all the module listing issues, this is a sizable subset and is well tested. Thanks all for contributing to this!
Comment #146
gábor hojtsyPublished change record at https://www.drupal.org/node/2914530
Comment #147
quietone commentedA bit confused here. The version of this issue is 8.4.x and it was committed to 8.5.x. Is this getting committed to 8.4.x?
Comment #148
catchRe-opening for 8.4.x cherry-pick consideration.
Comment #149
xjmOn a quick scan it looks like this patch has a bunch of API additions to stable core subsystems as well as to migrate which is in beta and so has the same BC policy according to stable code. According to #145 also adds BC internal breaks. What's the impact vs. risk of backporting it?
Comment #150
heddnWe discussed this in the migrate maintainers meeting today and decided not to push for a cherry-pick. Too many potential BC breaks. See #2920118: Update cck and field migration plugin as an example where we are trying to get ahead of things for 8.5.x
Tagging for 8.5 release notes.
Comment #151
gábor hojtsyThe 8.5.0 release notes need to mention the need for updates to modules due to the API change in the core experimental modules. Changes like #2920118: Update cck and field migration plugin needed in possibly other modules to be 8.5 compatible.