Forum Discussion
Best practice for provisioning Content Types on Modern Sites
How did you manage it out, finally? I have the exact same question.
I was told that you could simply provision the same Content Type name and ID from a site script (and add it to a library at the same time) and the Content Type Hub would hook up after and add the missing columns. I just tested it and it did not work at all. Error logs state that the CT already exists....
Francis Laurin we are currently using the pnp provisioning engine.
We created new content types and reused the fields from the content type hub.
It is easy to export fields from existing sites with pnp... After you added everything to your template you can start provisioning. The content type hub will add all the other (unused) fields.
Cheers
Bernd
- Praveen_BattulaSep 23, 2019Copper Contributor
Bernd Verhofstadt Francis Laurin So you have created new content types with same id, name from the content type hub and added all the existing fields from content type hub to your site design script or pnp provisioning engine?
If yes, did that work when the next content type sync happened? Are there any issues like when we publish from content type hub by adding or removing fields did that sync to all these site collection content types without any issue?
thanks
-Praveen.
- Francis LaurinSep 23, 2019Brass Contributor
Praveen_Battula, in my case, it never hooked up with the CT Hub. Synchronization logs showed error as the CTH complained that the columns already existed. I eliminated completely the CTH from my solution and only used Site Design and PNP Provisioning. It is a pain to update, though (need to update the script/template + apply changes via PowerShell on existing sites).
- Francis LaurinSep 23, 2019Brass Contributor
Reading again Bernd Verhofstadt comments, he says that the PNP provisioning should just provision the Content Type and not the fields (columns). This is how the CTH could pick it up and add the columns after. The problem with that is that when you provision a site, you expect to add your columns to list views which is impossible if you wait for the CTH to add them asynchronously, after the Site Design/PnP Provisioning application.