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

Feat/migrate pages to content hub #281

Closed tkrch closed 2 weeks ago

tkrch commented 3 weeks ago

Motivation

Continuation of #260 , #278

farmergeek94 commented 2 weeks ago

@tkrch While this is working good, there is one extra bit of info that is still coming in. The content types are still getting assigned to the channel via the table [CMS_ContentTypeChannel]. This allows them to still be added as web page items on the imported channel.

bluemodus-mwills commented 2 weeks ago

Hi @tkrch & @farmergeek94 -- @twozero6, @bluemodus-gfuller , and I are working on a migration right now, and would like to use this feature. Is it safe for us to work off this branch, or should we wait? Does the time it's taking on review mean there are known issues or changes are coming?

tkrch commented 2 weeks ago

Hi @bluemodus-mwills, yes some changes will be there, but not huge ones in terms how feature will be used. you can use this branch as a base. I will rebase it to master today.

tkrch commented 2 weeks ago

@bluemodus-mwills rebased onto master branch, i will speed-up remaining work in order to deliver fully functioning feature.

bluemodus-mwills commented 2 weeks ago

Thank you, @tkrch !

tkrch commented 2 weeks ago

Hi @bluemodus-mwills, @twozero6, @bluemodus-gfuller I have updated solution, interface (remodelling sample is unchanged). Only change from perspective of usage is removal of ConvertClassesToContentHub appsettings.json option (the other option CreateReusableFieldSchemaForClasses will be removed soon).

Sample AddReusableRemodelingSample stays unchanged and can be used to configure conversion correctly.

There is one thing that not directly affects feature and that is - what to do with child pages (if any present) under converted page. (i will raise this for further planning)

EDIT: use this branch, but hopefully PR will be soon accepted

farmergeek94 commented 2 weeks ago

@tkrch does the latest change force you to handle the entire mapping manually? It was really nice to just specify a config entry and have everything map one to one without needing to set up all of the field mappings.

We are also using this currently for a migration. Hence the question.

tkrch commented 2 weeks ago

@farmergeek94 yes, the setting was dropped in favour of mapping. Those 2 features were conflicting with each other, but if requested, it might return as form of "automapping" that would be configured through appsettings.json.

A more universal approach needs to taken, because there are multiple source types for conversion to content hub (custom classes, custom table or maybe basically anything if I implement mapping ability to load data).

@farmergeek94 I will re-introduce this setting next day back into this PR (for not breaking Your current process), but it will be replaced in future.

bluemodus-mwills commented 2 weeks ago

Thank you @tkrch !

farmergeek94 commented 2 weeks ago

Ok that makes sense. We can always fork that feature branch if we have to as well.

twozero6 commented 2 weeks ago

@akfakmot I've been working in this branch and I ran into a bit of an issue.

{72FFD4EB-B7FD-44A0-8B68-BB23984A4101}

When I hit line 227, f is null and throws an exception. Even if I swap the fields around, it's always the last field that has the issue. I did a bit of digging and found that the form definition on line 139 in MigratePageTypesCommandHandler.cs is always missing the last field. It also has some unexpected things as if the form definition from the source was merged with the new one. I did make sure that my field names were unique. Is this something you could look into?

Also, I can start a new issue for this if you think it's appropriate. Is it possible to get the Node context in the ConvertFrom method? For example, I would like to get the node's NodeGUID so that I can do additional lookups (get children) before setting the value.

tkrch commented 2 weeks ago

Hi @twozero6, i will look into it. From what I can see - You use for fields LinkMetaTextzzz and LinkMetaAriazzz same source field LinkText2. That might be the issue, i will check if it is supported (If not not, I will add support).

tkrch commented 2 weeks ago

@twozero6 that's the issue, fix is on the way

tkrch commented 2 weeks ago

@twozero6 field cloning introduced, let me know if feature works for You and in Your case

tkrch commented 2 weeks ago

@farmergeek94 requested feature re-introduced with handling of edge-cases. Please note, that in future, feature ConvertClassesToContentHub will be replaced with more general approach.

tkrch commented 2 weeks ago

@bluemodus-mwills, @bluemodus-gfuller feature is hopefully complete, if You have any feedback please share. Thanks TK

twozero6 commented 2 weeks ago

@tkrch the fix worked and I was able to import everything successfully. Thank you for the extremely fast turnaround!