Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bharani Dharan Jayasuri 11 posts 125 karma points c-trib
    Feb 07, 2019 @ 13:56
    Bharani Dharan Jayasuri
    1

    Archetype for Umbraco 8

    Hi all,

    We have used Archetype extensively for our website. Knowing that Archetype has now been sunset and Umbraco 8 is around the corner, does anyone have any ideas about migrating Archetype content to Nested Content?

    Bharani

  • Alex Skrypnyk 5239 posts 19096 karma points MVP 3x admin c-trib
    Mar 24, 2019 @ 22:17
    Alex Skrypnyk
    1

    Hi Bharani

    I'm afraid that there is no ready to use solution, but as I see it it's pretty easy to do by yourself.

    Example of how to create Nested content programmatically:

    // Same as in your above example, title and body text values
    var items = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(doc.GetValue<string>("nestTextContent"));
    
    items.Add(new Dictionary<string, object>() {
      {
        "title",
        "test"
      },
      {
        "bodyText",
        cleanedDescription
      }
    });
    
    doc.SetValue("pageContent", JsonConvert.SerializeObject(items));
    ApplicationContext.Current.Services.ContentService.Save(doc);
    

    Thanks,

    Alex

  • Nicholas Westby 1883 posts 6259 karma points c-trib
    Mar 24, 2019 @ 22:28
    Nicholas Westby
    2

    Haven't tried, but here are some ideas:

    • Publish All Content Publish all your pages in your old site (it's easier to work with Archetype on published pages than it is to work with on unpublished pages).
    • Export as JSON Export all your Archetype properties as JSON and store to a file. You now have a JSON file to work with rather than having to do some funky integration between two Umbraco versions. If you prefer to work with XML, this step may not be necessary (you could use the umbraco.config file that contains all the published content in XML format).
    • Create Nested Content Items Create document types and Nested Content items to match your Archetype fieldsets and data types.
    • Write Import Code Build an import that treats the Archetype values in the JSON as if they were Nested Content values.

    There may be some pain points, but they're common to any Umbraco 7 to 8 migration (e.g., resolve content and media pickers), so I won't go into detail about those here since this is an Archetype-specific thread.

Please Sign in or register to post replies

Write your reply to:

Draft