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?
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.
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?
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?
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.
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
Hi Andy,
MediaPicker should work. The related links I am not 100% sure of. Did you test?
Media should work fine indeed.
Best,
Richard
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
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
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
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
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
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
Hi Richard,
Thanks for that I am there now and have managed to import everything!
Thanks for all your help.
Andy
is working on a reply...