Importing schemas
Schemas exported from one Schema Registry instance can be imported into a different Schema Registry instance using the Schema Registry API.
You have two options. You can import schemas using the command line with curl or the Schema Registry Swagger UI. The following steps walk you through how you import schemas by using the Schema Registry Swagger UI.
On successful import, a number of SchemaMetadata, SchemaBranch, and SchemaVersionInfo objects are added to the Schema Registry database.
- Schema Metadata objects retain the ID, type, schemaGroup, name, description, compatibility, validationLevel, and evolve properties.
- SchemaBranch objects retain the ID, name, schemaMetadataName, and description properties.
- SchemaVersionInfo objects retain the ID, schemaMetadataId, name, description, version, and schemaText properties.
{
"successCount": 0,
"failedCount": 0,
"failedIds": [
0
]
}
- successCount is the number of successfully imported SchemaVersionInfo objects.
- failedCount is the number of SchemaVersionInfo objects that failed to import.
- failedIds contains the IDs of failed SchemaVersionInfo objects.
Schemas (metadata/branch/version) that are already present in the database are skipped during an import. Skipped schemas are not counted in successCount or failedCount.
- Ensure that the cluster, its hosts, and all its services are healthy.
- Ensure that Schema Registry is commissioned and running.
- Ensure that you have access to all credentials that are required to access and use Schema Registry.
- Ensure that you have access to a JSON file that contains the exported schemas that you want to import. For more information on how to export schemas, see Exporting schemas.
- Ensure that you are logged in as a user with access to the CDP Environment containing the cluster with Schema Registry.