Export and import of Document types have been a thing in Umbraco for some time and quite useful but there has been one issue that has driven me made for years now.
While if a specific custom property does not exist you can not use it any time you have a specific dropdown with values or a slider etc it never comes through the process. You have to always go into your Document Types and carefully go through and re-create all the values and setup.
It really defeats the purpose of the feature and I am surprised it has never been addressed.
Is it not possible to export the property options in the .udt files and then, if they do not exist to select on the other site to create them during the import process?
Presumably this is because the export only exports the document type and not the data type definitions (which is what I think you are referring to). I tend to use uSync to move schema definitions between environments as this works for everything.
Itās sort of a side effect of other things , it contains a dependency service that works out what other bits are required for a content type(or media or content or anything really) and can export them all as a single zip with all the bits in.
Upvote for managing this with uSync, but you can also fall back to creating a package, and import into the new site with an automatic package migration (rather than a full blown nuget pacakge)
For a one time import, the black box here still works ok, but it does have foibles for subsequent updates (doctypes can work, but if it finds an existing datatype it just exits without touching it)
Still a bit manual as doesnāt do the heavy lifting of knowing what datatypes are required, and compostions could also cloud the issue.
I get what you are all saying but you are kind of missing the point.
I would class this as a total lack of requirement or bug of a feature already existing. It is native Umbraco and should be something fixed as it is offered.
If you happen to have said field like a dropdown made and existing and you import the document type it will use it. IT has the knowledge to find if it is exists but it does not have any consideration to create the property if it does not.
I would have thought it would have been a simple matter of ensuring the property object was more defined when they are not default ones, check if exists and use, if not then create based on the details.
For that matter I think it would be about time these import export files shifted to JSON data.
To offer a different view.. It does what it says on the tin.. it exports the docType (and only the docType), and if you already have that datatype on your intended import location then the import also does what it says on the tin.
If you were to include all the dependencies on the doctype what happens then, you override/merge with that existing datatype?
I can see that for your specific use case of a brand new empty site you might want the docType to also bring dependencies.. But Iād then say thatās what creating a package is for, or uSync
As you say we might expect a native solution with json now for package exports over the old as the hills xml, but as uSync is so feature rich thatās already the modern alternative. or indeed Umbraco Deploy