Copied to clipboard

Flag this post as spam?

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


  • Andy Felton 53 posts 154 karma points c-trib
    Oct 08, 2017 @ 09:10
    Andy Felton
    0

    Field provider return values

    Hi,

    I'm importing data from another CMS and need to populate data types of Umbraco.MultipleMediaPicker and Umbraco.RelatedLinks, can you let me know the format of the object CMSImport needs from a Field Provider for each of these data types.

    Also on the MultipleMediaPicker will CMSImport also import the media if setup to do so?

    Thanks Andy

  • Richard Soeteman 3273 posts 9334 karma points
    Oct 09, 2017 @ 17:02
    Richard Soeteman
    0

    Hi Andy,

    MediaPicker should work. The related links I am not 100% sure of. Did you test?

    Media should work fine indeed.

    Best,

    Richard

  • Andy Felton 53 posts 154 karma points c-trib
    Oct 11, 2017 @ 13:15
    Andy Felton
    0

    Hi Richard,

    I did try both of these but am not sure what format you're expecting the object returned from the field provider to be in.

    Thanks Andy

  • Richard Soeteman 3273 posts 9334 karma points
    Oct 12, 2017 @ 06:04
    Richard Soeteman
    0

    Hi Andy,

    It's what Umbraco expects for these values if CMSimport doesn't have a provider for this. Just check the cmsPropertyData table how the value is stored and make sure your fieldprovider returns the same format.

    Hope this helps,

    Richard

  • Andy Felton 53 posts 154 karma points c-trib
    Oct 17, 2017 @ 06:26
    Andy Felton
    0

    Hi Richard,

    I've got this mostly working now. The problems came down to interpreting the Related Links with Media property types I was using on my old Umbraco 4 website.

    I can now convert external links correctly but could do with help on the following final issues.

    For internal links I have the ID of the node which was linked to on the V4 site but need to get the imported node ID on my new V7 site. Do you have any code which would show me how to query the CMS Import Relation table?

    Similarly I have a media (document) ID on my V4 site that I need to get the old media path for so I can provide it back for the normal data provider to perform an import. Again do you have any code which would demonstrate how to query media of the old database?

    Many Thanks for the continued help.

    Andy

  • Richard Soeteman 3273 posts 9334 karma points
    Oct 17, 2017 @ 07:48
    Richard Soeteman
    0

    Hi ANdy,

    I query the UmbracoNode table and the cmsPropertyData table for that info to get the old data from the old database. In the Umbraco Data provider.

    It's best to query the CMSImportmediarelation table directly if you have the id since the internal API queries based on filenames.

    Hope this helps,

    Richard

  • Andy Felton 53 posts 154 karma points c-trib
    Oct 17, 2017 @ 08:02
    Andy Felton
    100

    Hi Richard,

    Think I get that. For the media I'd need to query the old data from the old database as the media may not yet be imported. Is it possible for me to get to the connection string or do you have APIs to query the data?

    Thanks Andy

  • Richard Soeteman 3273 posts 9334 karma points
    Oct 17, 2017 @ 09:19
    Richard Soeteman
    0

    Hi Andy,

    On the FieldProvider options you should see the importstate which contains the dataprovider. That contains the datasource which is the connection string to your old database.

    Hope this helps, Richard

  • Andy Felton 53 posts 154 karma points c-trib
    Oct 18, 2017 @ 07:52
    Andy Felton
    0

    Hi Richard,

    Thanks for that I am there now and have managed to import everything!

    Thanks for all your help.

    Andy

Please Sign in or register to post replies

Write your reply to:

Draft