Hi, first off, the first errors I get are...
[error] upgrade_d6_field_formatter_settings Migration - 6 failed.
[error] upgrade_d6_file Migration - 97 failed.
[error] Missing bundle entity, entity type node_type, entity id affiliate. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id frontpage_slideshow. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id product_information. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] upgrade_d6_language_content_settings Migration - 3 failed.
[error] Missing bundle entity, entity type node_type, entity id frontpage_slideshow. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id product_information. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id simplenews. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[status] Processed 7 items (3 created, 0 updated, 3 failed, 1 ignored) - done with 'upgrade_d6_upload_field_instance'
[error] upgrade_d6_upload_field_instance Migration - 3 failed.
The content types it refers to are non-ubercart, normal node content types. They don't get migrated with commerce_migrate enabled.
The next general error I get is a dependency one...
[error] Migration upgrade_d6_node_product did not meet the requirements. Missing migrations d6_filter_format, d6_ubercart_attribute_field, d6_ubercart_product_attribute, d6_user_role, d6_ubercart_attribute_field_instance, d6_user, d6_ubercart_product_variation, ubercart_currency, d6_ubercart_store. requirements: d6_filter_format. requirements: d6_ubercart_attribute_field. requirements: d6_ubercart_product_attribute. requirements: d6_user_role. requirements: d6_ubercart_attribute_field_instance. requirements: d6_user. requirements: d6_ubercart_product_variation. requirements: ubercart_currency. requirements: d6_ubercart_store.
For some reason the above migrations don't have the upgrade prefix so the dependencies are not correct (sounds like a general migration_plus issue). Note I have upgrade_d6_filter_format in my migration group, but not d6_filter_format. Same applies to the rest.
Other errors:
[error] Missing bundle entity, entity type commerce_product_type, entity id affiliate. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type commerce_product_type, entity id faq. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type commerce_product_type, entity id frontpage_slideshow. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type commerce_product_type, entity id page. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type commerce_product_type, entity id product. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type commerce_product_type, entity id product_information. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type commerce_product_type, entity id webform. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[status] Processed 8 items (0 created, 0 updated, 7 failed, 1 ignored) - done with 'upgrade_d6_ubercart_language_content_settings'
Seems that something in the commerce_migrate module is breaking the migration of all my other content types.
At the end of the migration I have general Drupal fatal errors, the orders, products and variations have migrated but I don't have any fields in the product entity and thus no content for the products apart from the basic ubercart fields.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | interdiff.txt | 524 bytes | quietone |
| #18 | 2936636-17.patch | 635 bytes | quietone |
| #16 | 2936636-16.patch | 557 bytes | willeaton |
Comments
Comment #2
willeaton commentedComment #3
willeaton commentedActually, having said that, when disabling commerce_migrate and sub-module. I still get a lot of errors, it might not be a commerce_migrate issue...
[error] Attempt to create a field field_group_frontpage that does not exist on entity type node. (/home/william/willserv/am.es/web/core/modules/field/src/Entity/FieldConfig.php:293)
[error] Attempt to create a field field_group_frontpage that does not exist on entity type node. (/home/william/willserv/am.es/web/core/modules/field/src/Entity/FieldConfig.php:293)
[status] Processed 58 items (0 created, 0 updated, 25 failed, 33 ignored) - done with 'upgrade_d6_field_instance'
[error] upgrade_d6_field_instance Migration - 25 failed.
[status] Processed 6 items (6 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_view_modes'
[error] Missing bundle entity, entity type node_type, entity id frontpage_slideshow. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id affiliate. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id product_information. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
[error] Missing bundle entity, entity type node_type, entity id affiliate. (/home/william/willserv/am.es/web/core/lib/Drupal/Core/Entity/EntityType.php:883)
Comment #4
willeaton commentedAnother issue I have...
upgrade_d6_node_product fails here:
web/modules/contrib/commerce/modules/product/src/Entity/Product.php, line 285
Call to a member function isEmpty() on null
This is because, for some reason, $variation is just an id number, it is not a loaded object, therefore $variation->product_id->isEmpty cannot be applied.
In $this->variations I see this:
$this
values
[variations] Array
[target_id] 989
Comment #5
quietone commented@willeaton, sorry your getting so many errors and thanks for reporting them!
Quite a lot of errors, a summary here to help keep track.
1) d6_field_formatter_settings
What is in the map and message table? Anything special about those fields?
2) upgrade_d6_language_content_settings
That is reporting 'missing bundle entity'. For this to work both the d6_node_type and d6_ubercart_product_type migrations need to work correctly. Check the d6_node_type and d6_ubercart_product map and message tables to see if these types were migrated as expected. Look to make sure that the 'node' node types are in d6_node_type tables and only 'product' node types are in the ubercart one.
I looked at the language_content_settings migrations and made a change to the dependencies and the test but that shouldn't be an issue here. I haven't made an issue for that yet.
3) Dependencies
Since recent versions of drush 9, dependencies have been 'interesting'. Using this patch has helped #2935262: execute-dependencies not working. I haven't looked further than that.
4) Field groups?
I see that one of the fields is named, field_group_frontpage. Is that from the Field Group module? if so, there is an existing open issue for D6 field migrations, #2611904: Add migrate support for D6 fieldgroup. Perhaps this explains that one?
5) From #4. Call to a member function isEmpty() on null.
This is still todo, because the field migrations and node_type need to be working first.
Comment #6
willeaton commentedHi @quietone,
sorry for the delay in getting back to you, I'm not getting email updates as I should...
I need to get back to you about most of the above, however for:
3) Dependencies
This patch did fix the error but it caused the same migrations to be repeated many many times. I think certain top level migrations (like user) must have been called about 100 times. However all this did really was loop through all dependencies for all migrations, it didn't fix the root of the issue which is that migrate plus/tools is not adding the upgrade prefix to some of the migrations, nor is it included in the migration group I created, therefore I have to use this --execute-dependencies parameter otherwise some key migrations don't get run.
4) Field groups?
It is from the field group module. However I could have sworn that this had been working fine previously. Will look into that point.
In general, I checked the dblog after migration and there were no errors committed to log, not any migration errors anyway. Several migrations say they have failed but don't report why, I might need to debug them.
Comment #7
quietone commentedAh, the 'joys' of email. I know it well. NP, just post your results when you can.
3) Dependencies. Unless you need the prefixes for your setup, try setting it to an empty string. That helped me just yesterday.
4) OK
Also check the migrate_message_[migration_id] tables, e.g.,
drush mmsg d6_ubercart_storeComment #8
willeaton commentedGreat! I didn't know about these messages.
Response to point 1).
I get this error from d6_field_formatter_settings:
Take this example:
imagefield__lightbox2__product_full_thumbs__original
imagefield = the module
lightbox2 = the image view module on theme display
product_full_thumbs = imagecache profile
original = the imagecache profile to show on click.
Not sure if this is normal or if there is a bug here. Not even sure if this is a migrate but or a commerce_migrate field override bug.
It blocks the migration with this error:
PHP Fatal error: Call to a member function getConfigDependencyName() on null in /web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 314
Comment #9
willeaton commentedResponse for point 2)
I think the issue is in d6_node_type:
In the migrate_map_d6_node_type table I have nodes like webforms:
webform, webform, 0, 1, 0, ''
I also have ubercart products:
product, NULL, 2, 0, 0, ''
With respect to this migration - d6_ubercart_product_type, I have several warning messages "Config entities can not be stubbed.". I also have 2 tables:
migrate_map_d6_ubercart_product_type - this has an entry:
product, NULL, 3, 0, 0, ''
and migrate_map_upgrade_d6_ubercart_product_type - this has an entry:
product, product, 0, 0, 0, ''
I can't see upgrade_d6_ubercart_product_type in the migration list though... this is weird!
Comment #10
willeaton commentedOK, I think my base database has gotten mixed up at some stage, it seems to contain migration data already!!! Will reset and retry...
Comment #11
willeaton commented@quietone, great news. Bar a few, minor issue, I think I've got a full migration working!
Issue 1:
d6_ubercart_language_content_settings - seems to try and import content types that are not products
Issue 2:
d6_field_formatter_settings gives the following error and causes a fatal error:
Failed to lookup field type array (
0 => 'filefield',
1 => 'imagefield__lightbox2__product_full__original',
) in the static map.
PHP Fatal error: Call to a member function getConfigDependencyName() on null in
/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 314
Apart from that, I think I've got everything working!
Congratulations, and thanks so much for all the help along the way!
Comment #12
quietone commentedAwesome! That is such good news!!
Issue 1: I don't see anything obvious in the code to cause this, but it does assume that all products have a node_type like 'uc_product%' in the node_type table. Are there other node_types to consider/
Issue 2: Assuming that the d8 image module is enabled then is that field supplied by a contrib module or is it just a plain 'ole d6 imagefield?
Comment #13
willeaton commentedHi, sorry, didn't see the response...
Issue 1: There are other node types in my migration but they are not of type uc_product%. Is there any more info I can give you to help you figure it out? I might have to replicate the migration and debug, where should I look?
Issue 2: In d6 that is an image view preset with imagefield + imagecache + lightbox, it defines that the image should show an imagecache of "product_full" to start, and "original" when opening in lightbox. Image field is enabled in d8. Maybe this is something we don't want to fix, or maybe we could detect lightbox2 and ignore anything after to fail gracefully.
Comment #14
willeaton commentedHi @quietone.
I have noticed that fields that only belong to nodes (non-product fields) are not being migrated and I think I know why but not sure if the problem is really elsewhere. Its related to a migration error I have spotted before but not been able to fix...
I think the issue comes from \Drupal\commerce_migrate_ubercart\EventSubscriber\prepareRow, specifically this block:
I think we are missing an else on the if ($i > 0), basically what this bit of code is saying is - "If this field belongs to any known product types", which in the case of this field - doesn't, then set the source property "entity_type" = "node".
What Im finding is that fields which do not relate to products are not given an entity_type value in the $row->source therefore are not migrated. I think the code should be this...
Comment #15
willeaton commentedHi, anyone had a chance to look at this?
With this code change, I was able to do a complete migration of non-product entities and its respective fields
Comment #16
willeaton commentedHere's a patch if it makes things easier...
Comment #17
quietone commented@willeaton, thanks to heddn's prodding I finally took a look at this.
Yes this looks spot on. The d6_field migration is altered in the hook from
entity_type: 'constants/entity_type'toentity_type: 'entity_type'so the entity_type must be set for each row, which it was not doing.All I did here was to add a comment, add credit goes to willeaton.
Thanks for the fix!
Comment #18
quietone commentedIt would help to upload the patch.
Comment #19
heddnThis is RTBCed by @quietone in #18. The comment is just icing.
Comment #21
heddn