Copied to clipboard

Flag this post as spam?

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


  • hakan 24 posts 118 karma points
    Nov 19, 2019 @ 08:49
    hakan
    0

    uSync can I export all content in a single file

    I'm using uSync 8.3.0 and uSync.ContentEdition 8.2.4

    Is there any way pickup "all umbraco content" in a single xml file or json file?

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Nov 19, 2019 @ 09:30
    Kevin Jump
    1

    Hi,

    within the "normal" uSync setup, no there isn't (other than doing something programmatically.

    However the uSync.Exporter package which is part of uSync.Complete will package up all the content, dependencies and files (if needed) into a single 'sync pack' (.usync) file that can be moved between sites.

  • hakan 24 posts 118 karma points
    Nov 19, 2019 @ 10:03
    hakan
    0

    Thanks Kevin for your answer.

    I'm using "normal" uSync setup. How can I update uSync codes. is it in umbraco folder or should I use uSync.core? I couldnt find any way to update codes in documantation.

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Nov 19, 2019 @ 10:52
    Kevin Jump
    0

    Hi

    If you want to do this programmatically, you will need to use the Umbraco ContentService to enumerate through all of your content and call the Serialize method of the ContentSerializer inside uSync.ContentEdition to get the XElement for each item.

    You could then munge these XElements together into a single file

    for importing you need to do the same in reverse, calling the Deserialize method on each item,

    you would also need to pay attention to the level of each item, ensuring you import the pages at the lower levels before their children items.

    importing is also two pass so you would need to call DeserializeSecondPass once everything has been processed.

    *note this won't include media (only content) unless you do the same for media as above. uSync.Exporter has a dependency service that calculates the required media for content, streamlining this process

  • Giovanni Musicò 1 post 71 karma points
    Mar 15, 2021 @ 14:38
    Giovanni Musicò
    0

    Can you do an example about your post? I have the same problema but i don't kwon how to call the serializer. I update the following method to umbraco 8.

     XElement ExportContent(IContent doc)
            {
                XElement Xel;
    
                Xel = ps.Export(doc, false);
                foreach (IContent child in doc.Children())
                {
                    Xel.Add(ExportContent(child));
                }
                return Xel;
            }
    
Please Sign in or register to post replies

Write your reply to:

Draft