We've migrated a site from v7 to v8 and modelsbuilder cannot resolve any media as the model code is attempting to resolve media via Udi and all the properties are using the legacy integer id.
Is it possible to configure ModelsBuilder to resolve using the legacy id?
10/17/2023, 2:44 PM
This isn't related to Models Builder, but the property value converter of the property editor that you're using.
To bring your data up to date with Umbraco 8 and newer versions, it might be best to convert your data so that the references are saved as UDIs rather than numeric IDs.
If this isn't feasible, you could try to replace Umbraco's property value converter for the legacy media picker with your own. You can find the source code for Umbraco's here:
Notice line 15 - you shouldn't include this line as you'd otherwise run into problems with multiple value converters for the same property editor.
But the rest of the class should be good to copy to project, and you can then update the different bits from handling UDIs to handling numeric IDs instead.
10/17/2023, 2:48 PM
> To bring your data up to date with Umbraco 8 and newer versions, it might be best to convert your data so that the references are saved as UDIs rather than numeric IDs
Is there a way to automate this? I'm erring towards using a property value convertor as this site is likely to be completely rebuilt
10/17/2023, 3:04 PM
> Is there a way to automate this?
not out of the box - it involves using the content service for converting the affected values and republishing the pages