How to pass Reusable Field Schema to Kenticopilot

Im trying to migrate to XbyK 31.6.2

I've remodeled a lot of content in XbyK with heavy use of Reusable Field Schemas.

I want to pass this info on to KenticoPilot to help with the migration-plan and code-migration skills.

I can get the Page and Reusable Content Items xml schema easily by using

SELECT [ClassFormDefinition]
FROM [CMS_Class]
WHERE [ClassName] = 'Article'

But I don't know how to reference the fields in the Reusable Schema parts of the Article Content Item as they are only represented in the xml as a guid that I can't find any reference to.

I can't see how Kenticopilot can generate Field Mappings if it doesn't know the field details behind the reusable field schema. Searching the entire DB for the first guid only returns references to CMS_Class

<schema guid="dd9ec902-21fe-48dd-bb5c-5a11ca3a448f" name="dd9ec902-21fe-48dd-bb5c-5a11ca3a448f">

        <properties />

    </schema>

    <schema guid="e136cda7-94b7-4499-bc27-50a313d07aac" name="e136cda7-94b7-4499-bc27-50a313d07aac">

        <properties />

    </schema>

    <schema guid="f1cbde10-4643-4deb-8a40-1d8acc4324ba" name="f1cbde10-4643-4deb-8a40-1d8acc4324ba">

        <properties />

    </schema>

    <schema guid="b8542c98-bc7c-4214-8b4a-fba53d5a677a" name="b8542c98-bc7c-4214-8b4a-fba53d5a677a">

        <properties />

    </schema>

Would generating the C# code classes for the Content Item types be the better option and feeding that to KenticoPilot instead? I was giving it the XML as per the documentation https://docs.kentico.com/guides/upgrade-to-xbyk/upgrade-deep-dives/speed-up-remodeling-with-ai

Thank you

Tags:
KentiCopilot Migration / upgrade

Answers

Accepted answer

Thanks for your detailed question. The reusable field schema fields are stored separately in the CMS_ContentItemCommonData table. Unlike regular content type fields, which get their own dedicated table named after the content type, reusable field schema fields don't have their own table. They're added directly as columns to the shared CMS_ContentItemCommonData table, each prefixed with its schema's name to avoid clashes with other schemas.

So, as you suggest, generating code files and providing those as context for the AI agent using KentiCopilot is a much better option, especially if your reusable field schemas already exist in the target database. For example:

dotnet run --kxp-codegen --type "ReusableFieldSchemas" --location "..."
dotnet run --kxp-codegen --type "ReusableContentTypes" --location "..."

This generates C# interfaces with the real field names and types for each schema, along with the content type classes that use them. Then you can provide both sets of files to KentiCopilot.

Let me know if this answers your question or if you need any further clarification.

Separately, since you mentioned the https://docs.kentico.com/guides/upgrade-to-xbyk/upgrade-deep-dives/speed-up-remodeling-with-ai guide, I'd like to bring to your attention a new series on AI-assisted upgrades we've put together recently. It could be interesting to you and your use case: https://docs.kentico.com/guides/upgrade-to-xbyk/assisted-upgrades

Thanks Dominika. Can I assume that the schema guids are listed in the XML as they appear in my content types? Or is there some way i can match the GUID to the schema definitively?

A quick follow up: Reusable field schemas (and content types) are exposed over the Management MCP with full CRUD support. That's going to be the easiest way for an agent to understand what's available in your app's content model and make adjustments to it.

Additionally, the Content Model Graph extension has a JSON export feature which exports your entire content model as data. You could also provide this to an agent if you wanted it to generate a visualization for you and your team to inspect or use for upgrade planning.

Thanks for the info Sean.

In relation to the original issue, I found it easier in the end to scaffold my content types in a clean XbyK solution, generate the code, and have KenticoPilot look at that for reference.

To response this discussion, you have to login first.