Replies: 1 comment 1 reply
-
Hi, Yeah you could use the AddNewContentType, - in the GetConfigValues method (as example in the archetype migrator So in the order things run,
usually, you won't need the content type before step 3 so adding it in the GetConfigValue method should be, ok? In theory you can also have property-based migrators, so you can define the migrator you want to use based on the property alias or the contenttype_property alias. you would define that on your custom "migration plan" e.g uSyncMigrations/MyMigrations/MyMigrationProfile.cs Lines 55 to 62 in 6ea75b2 I am not sure at the moment there might not be away to do this by datatypeAlias - maybe that should be added. that way you might still need a custom migrator, but you wouldn't have to worry with the base values (not a big saving really - might not actually give you much) - it would mean you could have two migrators here one for each type. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to work out if/how it might be possible to add a new ContentType before a migration and Change the ContentType of existing elements within a NestedContent property. I'm not sure if I am missing an existing way to do this by overthinking the solution but as it stands I've had to do the following:
NestedContentMigrator
ContentTypeService
GetConfigValues
method in which I have a switch statement to allow me to return an amended configuration value depending on the datatype or use thebase.GetConfigValues(dataTypeProperty, context)
method if there is no match. In the amended config I am updating the old content type alias for the new one created in step 1.GetContentValue
method allowing me to update the content type of each row of nested content using a switch statement similar to step 3.It works but I wrote it before discovering AddNewContentType in ContentTypeMigrationContext but am unsure if it would be possible and better to somehow use that instead.
Any thoughts @KevinJump ?
Beta Was this translation helpful? Give feedback.
All reactions