-
I have an issue in a legacy site I am migrating whereby we have a doctype that is used within a nested content property editor that is also used for content nodes. This is causing issues in the migrated v12 site because content outside of the nested content is now using a doctype that has been converted to an element type (hopefully that makes sense?) but it should be As such, I am creating a duplicate of the original doctype and making that an element type and changing the original doctype back to normal. I now need to migrate any nodes within nested content using the original doctype so that it now uses the new element type. Explaining it sounds more complicated than the issue is but I hope it makes sense. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 13 replies
-
Here is my migration plan
...and here is my migrator
In the migrator I have a breakpoint at the start of the |
Beta Was this translation helpful? Give feedback.
-
Hi, Just ran a check of this for you locally, and for me the breakpoint does get hit 🤔 so here is what i have just done. 1 . I copied your NestedContentSlideShowSlideMigrator from above,
using uSync.Migrations.Configuration.Models;
namespace MyMigrations.CustomMigration;
internal class NestedSlideShowPlan : ISyncMigrationPlan
{
public int Order => 100;
public string Name => "Slideshow Migration plan";
public string Icon => "icon-show";
public string Description => "Run the slideshow nested content merge";
public MigrationOptions Options => new MigrationOptions
{
SourceVersion = 8,
PreferredMigrators = new Dictionary<string, string>()
{
{ Umbraco.Cms.Core.Constants.PropertyEditors.Aliases.NestedContent, nameof(NestedContentSlideShowSlideMigrator) }
},
};
} Ran a conversion of the site (which has some nested content in it). and the breakpoint gets hit migration looks like this : only thing is i am running this against the very latest code branch currently just merging the vorto-context-lookup branch - but none of the basic look up stuff should have changed since the last version 🤷 |
Beta Was this translation helpful? Give feedback.
-
Prior to making the changes you advised above I did do a full export of content and media from uSync to ensure there were Content and Media in the v9 directory although I understood from our previous conversation on Discord that it shouldn't be necessary for this example and because I was coming from v7. That said, I made the changes you detailed above and I am running it again now in the hope that I see the same success that you did 🤞 Thanks for your input on this - much appreciated! I will give feedback on my results soon. |
Beta Was this translation helpful? Give feedback.
-
yes that depends on where the source is - so in my example i was converting the current site. if you wanted to convert directly from the v7 files you can do it, but then it becomes a v7 migration not a v8(+) one. another thing though - if you are coming from Umbraco seven you might want to add. support for "Our.Umbraco.NestedContent" e.g have the following attributes. [SyncMigrator(UmbConstants.PropertyEditors.Aliases.NestedContent)]
[SyncMigrator("Our.Umbraco.NestedContent")]
[SyncMigratorVersion(7,8)] depending on what version of v7 you have the alias might be this old one. |
Beta Was this translation helpful? Give feedback.
-
Yes - That method is fine, but i think you 'v8' conversion should point at your uSync/v9 folder
When doing this way I think step 2 is the key here. You could in theory do it all in one step, but i can see why doing it in a few makes a bit more sense and gives you more control |
Beta Was this translation helpful? Give feedback.
-
@KevinJump Can I have more than one NestedContent migrator execute in a single migration plan? I have a lot of work to do in regards to nested content and it would great not to have to end up with lots of separate steps and additional wait time to execute them. |
Beta Was this translation helpful? Give feedback.
-
ermm... yes i think you can... you can override the migrators per 'property' PropertyMigrators = new Dictionary<string, string>
{
{
"MyNestedContentPropertyAlias", "MyCustomNestedContentMigrator"
}
} you can also do it per property on a content type. so |
Beta Was this translation helpful? Give feedback.
-
I just tried this and it didn't seem to have any effect on my nested content as looking at the migrated files I still see the old content type aliases in the nested content after. This is what my options look like in the migration plan:
|
Beta Was this translation helpful? Give feedback.
Yes -
That method is fine, but i think you 'v8' conversion should point at your uSync/v9 folder
When doing this way I think step 2 is the key here.
You could in theory do it all in one step, but i can see why doing it in a few makes a bit more sense and gives you more control