Copied to clipboard

Flag this post as spam?

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


  • Jeremy Loeckler 10 posts 52 karma points
    Jan 23, 2014 @ 20:17
    Jeremy Loeckler
    0

    Importing Children to Pre-existing Parents

    I need to import content that has a child relationship to existing nodes in the database. I do have a key to pair the records, however these nodes were not imported from CMSImport and therefore don't have any metadata in the CMSImport infrastructure.

    Can I achieve this by creating some thoughtful records in the CMSImportState and CMSImportRelation tables? Is that the best and/or easiest technique? Am I missing something more obvious?

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jan 24, 2014 @ 08:06
    Richard Soeteman
    100

    Hi Jeremy,

    Yes for now adding a relation CMSImportRelation table is the best thing you can do. In a next version I will add an option to map on nodename as well. Structure in CMSImportRelation table for the key is [Data source alias][Primart key column][primary key value]. Maybe import one record to see what you need to fill in is the best.

    Hope this helps.

    Best,

    Richard

  • Jeremy Loeckler 10 posts 52 karma points
    Jan 24, 2014 @ 16:32
    Jeremy Loeckler
    0

    Thanks! Initial results look good. We'll see how it goes when I try importing 20K nodes.

    Looking forward to the feature that you mentioned. Ideally the option to map would allow selection of a field rather than binding exlusively by nodename. It's common for duplicate node names to exist throughout a deep content hierarchy.

    For example, when I have a parent that will have many children (50+), I'll typically create a very simple Folder Document type and name the nodes A, B, C,... Z. Then the children attach to that by the first character in their node names. It makes usage of the content tree a bit more bareable.

    • Pets
      • A
        • Aardvark
        • Antelope
      • B
        • Boa
    • Wild Animals
      • A
        • Artic Fox
        • Antelope
      • B
        • Bison
    In this case I'd probably toss a key into a property of those documents that includes the first letter.
  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jan 25, 2014 @ 06:38
    Richard Soeteman
    0

    Wow that is a situation I have not thought about yet :) Thanks for brining this up. But I have misread the initial post was about relations to the parent. In a next version you can still use the mentioned solution but it's best to do the structured import to first import  of all the letters in this case and then the children. Both can map then so it will update what's already there but then it's imported in the way CMSImport was designed for lookups. Hope this makes sense.

    Cheers,

    Richard

  • Jeremy Loeckler 10 posts 52 karma points
    Jan 25, 2014 @ 18:45
    Jeremy Loeckler
    0

    No problem. I did it that way in practice. I just didn't want to complicate the original question with the depth issue.

    I created a full top-to-bottom hierarchy using single row queries. I used the node they created to ensure I had the right syntax for the CMSImportRelation table.

    This worked very well. I did need to toss an index on the DataSourceKey in the CMSImportRelation table. This improved performance as my import history grew (over 50,000).

    BTW - The OFFSET feature in SQL Server 2012 queries has helped tremendously as I've needed to import the data in batches.

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jan 27, 2014 @ 07:11
    Richard Soeteman
    0

    Thanks for reply will need to add some indexes indeed I did not know about offset, that said I can't determine the version of SQL server so that would propably not work :-(

    Thanks,

    Richard

  • Ben Schlaepfer 74 posts 101 karma points
    May 05, 2014 @ 11:49
    Ben Schlaepfer
    0

    Hi there guys,

    This thread feels like it's in the same kind of place as my question so here we go!

    One of two posts from me today, thought it better to keep them separate as different topics.

    My content structure is:
    Products -->
        Connectors -->
            Connector Family A -->
                Connector A1
                Connector A2
                ...
            Connector Family B
            Connector Family C       
            ....
            Connector Family Z
           
    I've read up on Recursive Import and it feels like this should be a useful tool but I just can't get my head around how to use?

    The goal is to have just one CSV file with Connectors from all families and one import definition.

    All of the target nodes exist, CMS Import will JUST be updating content items at the Connector level.

    Ideally the import would "act" as if the actual items were all direct children of Connectors and share the same doc type.

    If there is a step by step guide or any other examples I could learn from I'd really appreciate that info...

    Many thanks
    Ben

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    May 06, 2014 @ 20:24
    Richard Soeteman
    0

    Hi Ben,

    What you need is a key between Connector and its parent. That is the only way the Recursive import will work. Have you already checked out the video Structured content on http://soetemansoftware.nl/cmsimport/videos

    That explains the recursive import better I think. Updating only works when data is already imported using CMSImport. But for the rest I think the functionality is what you need. But as mentioned, better to check the video first.

    Hope this helps.

    Richard

  • Ben Schlaepfer 74 posts 101 karma points
    Jun 05, 2014 @ 18:37
    Ben Schlaepfer
    0

    Hi Richard,

    Thanks for your response. I've been looking at alternative ways to solve my issue but not really been all that lucky.

    When I ran my initial imports I did them by Connector Family, one Family at a time, so I do not think my CMS Import defiinition is aware of the overarching "Connectors" node above it.

    I need to be able to address a handful of fields for all connectors regardless of their family. Each connector has a unique identifier and they all share a Content Type.

    The fly in the ointment is that they sit in their family node (for ease of content management).

    Starting again with importing the parts is not an option as a fair bit of manual update within Umbraco has taken place.

    Is there any way of retrospectively addressing this, or can you think of another way, from a single CSV that I can update my ~900 content nodes given the structure above?

    Once again any pointers most appreciate.

    Thanks,

    Ben

     

     

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jun 06, 2014 @ 07:36
    Richard Soeteman
    0

    Hi Ben,

    What you can do is add the records to the CMSImportRelation table manually.

    The format of the DataSourceKey is [provider][primary key name][primary key value]

    Add that to excel combine the node ids and add the records to sql server then the relation is available and CMSImport will update the records.

    Does this make sense?

    Best,

    Richard

  • Comment author was deleted

    Jan 25, 2015 @ 21:40

    Hi Richard,

    Thank you so much for your suggestions on this thread, it's really helped me with getting all my client's products from their old website into Umbraco + uWebshop2.

    I already had my categories in place, so this thread made it simple for me to configure CMSImport (with a little manual tinkering) to get the rest off the 3.5k products onto the site.

    Thanks,

    Graham

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jan 26, 2015 @ 07:26
    Richard Soeteman
    0

    Great to hear!

    Thanks,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft