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
7 stars 3 forks source link

Enable migrating resusable schema inheritance from base type inheritance #242

Closed bluemodus-mwills closed 3 weeks ago

bluemodus-mwills commented 2 months ago

Motivation

Currently, the Migration Tool allows migrating some types as reusable schemas, but it doesn’t use the reusable schemas in the migrated derive types or content.

Proposed solution

To make it much more valuable, the migration would use the created reusable schemas in the migrated types, by detecting page types that inherit from the source base types, adding the reusable schemas to types in the target database, and using the reusable schema fields when migrating the content.

This could get complex, so the preferred solution would be to add this capability to the request in https://github.com/Kentico/xperience-by-kentico-kentico-migration-tool/issues/241. This would allow custom code to extend the migration tool and define which types should be migrated as reusable schema types, which reusable schema types should be inherited by other types, and which source fields should be mapped to new reusable schema type fields.

seangwright commented 2 months ago

This was also mentioned in #183

DavidSlavik commented 1 month ago

@bluemodus-mwills Did you see this? https://github.com/Kentico/xperience-by-kentico-kentico-migration-tool/issues/183#issuecomment-2135340753

Is it what you need, or do you need something else?

bluemodus-mwills commented 1 month ago

@DavidSlavik - Yes, Sean's request is the same as this one. #242 is a dup of #183.

The only difference is the suggested approaches. @seangwright suggests an automatic approach that analyzes multilayers of base types to determine what unique schemas should be created.

My suggestion plays off the idea of providing a way to extend the Migration Tool to map old page types to new pages times in #241. It's another way, and it might allow solving both problems with one approach.

bluemodus-mwills commented 3 weeks ago

This is solved by the new Migration Tool Extensions feature, which allows creating a custom class mapping extension, which allows mapping multiple source types (and it's content) to a single target type. The mapping allows defining new fields, changing field names, skipping fields, changing data types, and using reusable schemas.

PR https://github.com/Kentico/xperience-by-kentico-kentico-migration-tool/pull/257

Readme: https://github.com/Kentico/xperience-by-kentico-kentico-migration-tool/blob/feat/238_ability_to_extend_migration/Migration.Tool.Extensions/README.md