Jumoo / uSyncMigrations

Rough and ready migration code.
Mozilla Public License 2.0
44 stars 57 forks source link

Support Variant content migration (v8 -> v10+) #225

Open KevinJump opened 11 months ago

KevinJump commented 11 months ago

At the moment we don't support migrating variant content - which is only a convert issue

The migrator(s) have been built (at the moment) to convert the content values

<pageTitle>
      <Value><![CDATA[Page Title]]></Value>
</pageTitle>

but in v8+ content might have multiple values :

<pageTitle>
      <Value Culture="cy"><![CDATA[Welsh Page]]></Value>
      <Value Culture="en-us"><![CDATA[Page Title]]></Value>
</pageTitle>

So we need to change the logic a bit to cope with their being multiple values.

In theory its simple enough but the edge cases make it a bit of an intelectual challenge.

there are splittng and merging migratiors that may take a single value

<complexProperty>
      <Value><![CDATA[[{"one": "one", "two": "two"]]>></Value>
</complexProperty>

and make it

<propertyOne>
      <Value><![CDATA[[One]]>></Value>
</propertyOne>
<propertyTwo>
      <Value><![CDATA[[Two]]>></Value>
</propertyTwo>

so with multple values these get complex.

now they are super rare, and at the moment there might not be any of these for a v8 to v10 site, so we could just say the splitters and mergers will work as they do but won't support multi-lingual, but for normal properties we do support multilingual

and just fix the core case ?

anyway - up for grabs.

this in the sharedContentBaeHandler : https://github.com/Jumoo/uSyncMigrations/blob/main/uSync.Migrations/Handlers/Shared/SharedContentBaseHandler.cs#L120-L163

likely needs splitting up a bit with somebits going into the v8 sharedContentBase handler ?? https://github.com/Jumoo/uSyncMigrations/blob/main/uSync.Migrations/Handlers/Eight/ContentBaseMigrationHandler.cs

CodingDK commented 9 months ago

Hello @KevinJump

I have made a working solution for the culture variant issue here: https://github.com/CodingDK/uSyncMigrations/commit/5faaf22222c6277e43da61a54927b280b1e00369 I know it may not be the most beautiful solution - but it solved my problem. :-)

I've also made some other fixes that might be worth looking at. https://github.com/CodingDK/uSyncMigrations/commits/main Feel free to take a look and let me know if you have any questions

khraibani commented 3 months ago

Hello @CodingDK and @KevinJump I have a multi-lingual, multi-tenant running on U8 v8.18.12 I have managed to migrate the ContentTypes, DataType, Media etc but without the actual content the migration pack didn't contain it. Is that due to the variants? What is the best way to migrate the content across?