Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.
SOLVED

How to Duplicate and Modify a Schema in AEP for Testing Purposes

Avatar

Level 2

Hi everyone,

 

I’m looking for guidance on how to duplicate an existing schema in Adobe Experience Platform (AEP) for testing purposes, without affecting the original schema.

For example, I’d like to change the data type of a field from integer to string and observe how incoming data behaves. Instead of making this change directly in the original schema, I want to create a copy of the schema, apply the change there, and verify how the data flows through it.

Does AEP support duplicating a schema directly, or is there a recommended way to clone and modify a schema safely?

 

Also, if I were to update the data type (e.g., from integer to string) directly in the original schema, what impact would that have on incoming data? Will AEP automatically handle this type conversion, or could it cause issues with existing or incoming records?

Any suggestions or best practices would be greatly appreciated.

 

Thanks in advance!

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hey! Seems like this related to your other question regarding the loading of data after changing the data type. 

You have two options for dupliating the Schema - but either way- it will be totally agnostic of your original Schema. The first is to manually recreate it in the Schema Editor UI. This can be time consuming and is ripe for human error when attempting to duplicate with subtle changes. 

The better path requires some API knowledge but is fairly straightforward! You can use the schema registry APIs to call a get which will give you the JSON structure of the Schema. You then can take that response, update the $id, if you're looking to update your CRMID, you can find that field and update the datatype within the properties object and update the type from integer to either string or long, and then update your schema metadata (Title, Description) and then fire it to the post endpoint - et voila you have your new schema with the updates!

I find Postman to be incredibly easy to use for this use case, and it is very easy to incorporate into AEPs tooling and cURLs.


Here's the Schema Registry API documentation: Schema Registry API
Here's some additional info in the Schema Registry GitHub: experience-platform-postman-samples/apis/experience-platform/Schema Registry API.postman_collection....

Once again, let me know if you have any additional questions! Hope this gets you what you need!

Tyler Krause

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Hey! Seems like this related to your other question regarding the loading of data after changing the data type. 

You have two options for dupliating the Schema - but either way- it will be totally agnostic of your original Schema. The first is to manually recreate it in the Schema Editor UI. This can be time consuming and is ripe for human error when attempting to duplicate with subtle changes. 

The better path requires some API knowledge but is fairly straightforward! You can use the schema registry APIs to call a get which will give you the JSON structure of the Schema. You then can take that response, update the $id, if you're looking to update your CRMID, you can find that field and update the datatype within the properties object and update the type from integer to either string or long, and then update your schema metadata (Title, Description) and then fire it to the post endpoint - et voila you have your new schema with the updates!

I find Postman to be incredibly easy to use for this use case, and it is very easy to incorporate into AEPs tooling and cURLs.


Here's the Schema Registry API documentation: Schema Registry API
Here's some additional info in the Schema Registry GitHub: experience-platform-postman-samples/apis/experience-platform/Schema Registry API.postman_collection....

Once again, let me know if you have any additional questions! Hope this gets you what you need!

Tyler Krause

Avatar

Level 8

Hi @AEPuser16 ,

 

1) AEP does not provide a direct "duplicate schema" or "clone schema" feature in its UI or APIs.

Recommended approach to clone or duplicate a schema safely:

  • Export the existing schema definition
  • Modify the exported schema JSON
  • Create a new schema
  • Validate the new schema

2) Changing the data type of a field in an existing AEP schema is not recommended and can cause serious data ingestion issues like data ingestion failures.

Reference: https://experienceleague.adobe.com/en/docs/experience-platform/xdm/schema/best-practices

 

Thanks

Ankit