Kentico / xperience-by-kentico-kentico-migration-tool

A customizable tool that migrates older Kentico solutions to the latest version of Xperience by Kentico.
MIT License
8 stars 5 forks source link

Categories not being migrated #300

Open twozero6 opened 1 week ago

twozero6 commented 1 week ago

I have two page types that I am migrating:

ItemFolder -ItemAsset

ItemFolder is being migrated as-is, without any mapping class. ItemAsset has a ClassMapping class.

Both ItemFolder and ItemAsset have categories assigned on the Properties > Categories tab in the source.

When the migration is done, a new "Categories" taxonomy container does get created in the target. However, the Legacy_Categories reusable schema does not get created, and it does not get assigned to either the Folder or the Item class.

Please let me know if any other information would be useful for debugging this. Thank you!

tkrch commented 6 days ago

Hi @twozero6, can You post error messages from log if there are any? (one of type is sufficient) Thanks, TK

twozero6 commented 5 days ago

Hi @tkrch, there are no errors in the log, but I have an update. I am not sure what I did differently but I am seeing the "Categories" taxonomy container get created, as well as the legacy categories under it. I also see the "Categories container" reusable schema and the correct categories assigned to the Folder item (Resource Asset Folder) that is automatically being migrated.

I am not seeing the same container with categories\tags on the child items (Resource Asset) - the difference might be that there is a custom mapping class for the Resource Asset type. I ran the same test on another class of type Blog Post and have the same result - the container and categories are not being assigned. Does the custom mapping class change how the categories\tags get migrated?

twozero6 commented 4 days ago

Hi @tkrch, I found some warnings that might be helpful:

[WRN] Data class not found by ClassGuid 55ff97fa-9a97-499d-aba9-23331860dfa5 (628d7ef6) [WRN] ContentItemCommonDataInfo cannot have categories migrated, data class is not patched with taxonomy field. DocumentGuid ba950fc7-666b-44ea-a410-c102194b5704 (5f8ffede)

What's unusual is that I do get the class with that GUID if I run this query:

SELECT C.ClassName, C.ClassGuid, C.ClassID FROM View_CMS_Tree_Joined [TJ] JOIN dbo.CMS_DocumentCategory [CDC] on [TJ].DocumentID = [CDC].DocumentID JOIN CMS_Class [C] ON TJ.NodeClassID = [C].ClassID JOIN dbo.CMS_Category CC on CDC.CategoryID = CC.CategoryID AND CC.CategoryUserID IS NULL GROUP BY C.ClassName, C.ClassGuid, C.ClassID

tkrch commented 4 days ago

@twozero6 this error means, that DataClass (CMS_Class) entity with ClassGUID 55ff97fa-9a97-499d-aba9-23331860dfa5 was not found in XbyK instance, was it dropped and mapped to another type using MultiClassMapping? That could be the issue, if so i will fix it as a bug.

twozero6 commented 4 days ago

@tkrch that's exactly what happened - that class is being mapped to another type. Thank you!

tkrch commented 4 days ago

TODO: add support for class mapping to KVA/Migration.Tool.Source/Handlers/MigrateCategoriesCommandHandler.cs, category migration needs to recognize that old class was dropped and new class was created instead. Further control on mapping should be added to allow/disallow category migration on mapped type, because it will assign reusable schema. FYI @akfakmot

@twozero6 this is meaningful feature, hopefully it will be in next version.