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 12 posts 126 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 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 24, 2019 @ 22:17
    Alex Skrypnyk
    101

    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 2054 posts 7100 karma points c-trib
    Mar 24, 2019 @ 22:28
    Nicholas Westby
    3

    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