CLI tool- New schema validation option
Release date: 19th March 2025
The CLI tool now gives you greater flexibility for migrating content, with a new "Ignore schema validation" feature. With this feature you can quickly migrate content items, bypassing schema validation that may prevent content migration.
The "Ignore schema validation" feature is designed for use with environments where users are not actively creating and updating production content. For example, it allows you to copy, move and import content items for your testing and QA environments, where schema validation isn't necessary.
Setting hubs to ignore schema validationLink copied!
Schema validation is performed by default when you use the CLI tool to migrate content items.
You can choose the hubs for which the CLI tool is allowed to ignore validation, from the Dynamic Content "Properties" settings.
To help guard against developers using the –-ignoreSchemaValidation
flag inadvertently, the "Ignore schema validation" setting on hubs must be set by a user with either the organization admin or hub admin role.
Once the hub level validation option is set, developers can choose whether to ignore validation when using the CLI tool.
Ignoring schema validation when migrating contentLink copied!
To ignore schema validation when migrating content items, developers need to:
- Ensure the destination hub to set to ignore schema validation.
- Use the
–-ignoreSchemaValidation
flag with the following content item commands:- Import
- Copy
- Move
- Archive
- Unarchive
You can also use the –-ignoreSchemaValidation
flag when cleaning and cloning hubs.
Here's an example, of how "ignore schema validation" works. In the schema snippet shown below, we have two properties, headline
and strapline
:
In this example you want to import content items created from this content type schema to a new hub. That hub has a different version of the content type schema, where the properties are both required fields:
The CLI will detect if the content you are trying to migrate doesn't meet the destination schema validation and will not import the content, unless you use the --ignoreSchemaValidation
flag to bypass the validation of the properties, for example:
Using the --ignoreSchemaValidation
flag will allow the content to be imported. The content items can be opened in the Dynamic Content authoring experience, and where possible the authoring experience will highlight where content values don't pass validation. With this example, any migrated content items with values missing for the headline
and strapline
properties, can be opened and their values populated.
The --ignoreSchemaValidation
flag only applies to the body of the content, and some additional validation will always be done that can cause content items to fail to be imported. See Scope of the ignore validation flag.