Migrating NestedContent Property Data to BlockList...
# help-with-umbraco
p
I am in the process of completing a large scale migration from v7 to v12. I've got most of the content coming across now but as this is a major upgrade and NestedContent is being deprecated I want to deal with it now. I wanted to see if anyone has already had success directly migrating content from NestedContent to BlockLists?
a
There was a new discussion about this on GitHub yesterday: https://github.com/umbraco/Umbraco-CMS/discussions/14502
As mentioned by Bjarke, there might be some community packages that handles this. I have my own Limbo.Umbraco.Migrations as well. It doesn't support Nested Content at the moment, but it will in a few days as I need this for the site I'm migrating. https://github.com/limbo-works/Limbo.Umbraco.Migrations
It's mostly an internal package for now, but it's based on the code I've used for migrating a pretty large site, and then as a package, I've also used it migrating a medium sized site.
k
uSync.migrations will also convert nested content' (and grids) to block list (and block grid) as part of the migration process if you ask it too https://github.com/Jumoo/uSyncMigrations
p
Thanks Umbracians, I will have a read over all of this and experiment to see what works for us and feedback where necessary.
I wish I had stumbled across this earlier 😬 I have had to build out something similar myself. It's successfully imported all my doctypes and media but I still have an empty content tree and it looks like no content was imported. Do warnings in the log prevent the process from completing or just errors? There are lots of warnings along the lines of: > DeserializeProperties: item "XXX" doesn't have property '"XXX"' but its in the XML
k
Warnings shouldn't prevent content , but "xxx" doesn't have property prob means the property wasn't created on the doctype , sininwiuld check them
p
On further investigation those messages all related to media. What appears to be preventing the import of content is the error:
Publish Failed: FailedPublishPathNotPublished []
which occurs on what appears to be every single node. Just seeing if I can find out why.
Is it correct that during the content import all nodes get logged as follows:
Copy code
Document {ContentName} (id={ContentId}) has been published.
where
ContentId
is always zero? I wondering if this is the source of my issues as because this happens for all top level nodes from the original v7 site all subsequent imports fail with publish errors because the parent is not published.
Copy code
Failed to publish FailedPublishPathNotPublished
I've created [an issue](https://github.com/Jumoo/uSyncMigrations/issues/154) @Kevin Jump and will update it with anything further I can find out
I've managed to get from v7 > v10 > v12. I still need to go back and fill in some gaps but making good progress 👍
u
Hi! I'm getting this serialization error when I try to migrate from nested content to a blocklist: Error: https://pastecode.io/s/ojtdr95b uSync File xml: https://pastecode.io/s/jxabosk2 This is just an example, it happens for each nested content in my website. I'm using Umbraco 11.3.1 and uSync.Migrations 4.0.0-phase.3
s
You can also just post it here 😉 Error:
Copy code
System.Exception: Failed migrating [Umbraco.NestedContent - achievementsList] : Additional text encountered after finished reading JSON content: [. Path '', line 20, position 1.
 ---> Newtonsoft.Json.JsonReaderException: Additional text encountered after finished reading JSON content: [. Path '', line 20, position 1.
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at uSync.Migrations.Migrators.Optional.NestedToBlockListMigrator.GetContentValue(SyncMigrationContentProperty contentProperty, SyncMigrationContext context)
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.MigrateContentValue(SyncMigrationContentProperty migrationProperty, SyncMigrationContext context)
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.ConvertPropertyValue(String itemType, String contentType, XElement property, SyncMigrationContext context)
   --- End of inner exception stack trace ---
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.ConvertPropertyValue(String itemType, String contentType, XElement property, SyncMigrationContext context)
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.MigrateFile(XElement source, Int32 level, SyncMigrationContext context)
   at uSync.Migrations.Handlers.MigrationHandlerBase`1.MigrateFolder(String folder, Int32 level, SyncMigrationContext context)
XML:
Copy code
xml
   <achievementsList>
      <Value Culture="de"><![CDATA[[
  {
    "key": "b21f4fa1-9fa5-4109-96ef-f6c2f08d324f",
    "name": "test",
    "ncContentTypeAlias": "listEntry",
    "value": "test "
  },
  {
    "key": "d52e1514-9081-431f-9a75-723258e11b2b",
    "name": "test",
    "ncContentTypeAlias": "listEntry",
    "value": "test "
  },
  {
    "key": "4d60abab-e1d5-4642-bb1f-9e3553b20a6d",
    "name": "test",
    "ncContentTypeAlias": "listEntry",
    "value": "test "
  }
]]]></Value>
      <Value Culture="en"><![CDATA[[
  {
    "key": "830c0ea7-46b4-4330-81f7-feb1e755c8a9",
    "name": "test",
    "ncContentTypeAlias": "listEntry",
    "value": "test"
  },
  {
    "key": "0335636a-8e80-4ecd-b64f-7d3a7f622bf5",
    "name": "test",
    "ncContentTypeAlias": "listEntry",
    "value": "test"
  },
  {
    "key": "4b409bf5-312f-4a7c-b9ab-4f4145f5cd0a",
    "name": "test",
    "ncContentTypeAlias": "listEntry",
    "value": "test"
  }
]]]></Value>
    </achievementsList>
p
Is it expecting JSON in the value property for a
listEntry
?
4 Views