このコンテンツは選択した言語では利用できません。
Chapter 10. Migration scripts reference
The migration scripts automate key steps in the workflow. All scripts support interactive and automated modes using environment variables, with OAuth2 authentication support.
Understanding migration scripts
The migration scripts are production-ready tools that handle the most critical and error-prone aspects of migration:
- apicurio-capture-metrics.sh - Captures metrics before/after migration (for comparison)
- apicurio-export-registry-data.sh - Exports all data from 2.6
- apicurio-import-registry-data.sh - Imports data into Apicurio Registry 3.x
- apicurio-verify-registry-version.sh - Verifies registry version and health
- apicurio-verify-v3-api-features.sh - Tests v3-specific API features
Find all scripts in the Apicurio Registry GitHub repository under docs/scripts/.
Understanding common features
All migration scripts share these common features:
Interactive and automated modes:
- Interactive mode: Scripts prompt for required inputs with sensible defaults
- Automated mode: Set environment variables to skip prompts (useful for CI/CD)
OAuth2 authentication support:
- Client credentials grant type
- Configurable token endpoint and client credentials
- Optional: Run without authentication for testing environments
TLS/HTTPS support:
- Works with trusted certificates by default
-
Option to skip TLS verification for development/testing (
SKIP_TLS_VERIFY=true)
Clear output and error handling:
- Color-coded output (info, success, warning, error)
- Detailed progress indicators
- Clear exit codes for automation (0 = success, 1 = failure)
Script: apicurio-capture-metrics.sh
Purpose: Captures metrics from registry before and after migration.
What it captures:
- Total artifact count
- Sample of up to 5 artifacts with full metadata
- Global rule configurations
- Output saved to text file for post-migration comparison
Usage (interactive):
./apicurio-capture-metrics.sh
./apicurio-capture-metrics.sh
Usage (automated):
Environment variables:
| Variable | Description |
|---|---|
|
|
Registry base URL (for example, |
|
|
API version to use (default: |
|
|
Set to |
|
| OAuth2 token endpoint URL |
|
| OAuth2 client ID |
|
| OAuth2 client secret |
|
|
Output file path (default: |
|
|
Set to |
Output:
Text file containing artifact summary and global rules (default: registry-baseline.txt).
Script: apicurio-export-registry-data.sh
Purpose: Exports all data from 2.6 deployment to a ZIP file.
What it exports:
- All artifacts and versions
- Artifact metadata (labels, properties, descriptions)
- Global and artifact-specific rules
- Artifact references
Usage (interactive):
./apicurio-export-registry-data.sh
./apicurio-export-registry-data.sh
Usage (automated):
Environment variables:
| Variable | Description |
|---|---|
|
|
Registry base URL (for example, |
|
|
API version to use (default: |
|
|
Set to |
|
| OAuth2 token endpoint URL |
|
| OAuth2 client ID |
|
| OAuth2 client secret |
|
|
Export file path (default: |
|
|
Set to |
Output:
ZIP file containing complete registry export (default: registry-export.zip).
Important notes:
- Run this script while the registry is in read-only mode to maintain data consistency
- The export file size varies depending on registry size
Script: apicurio-import-registry-data.sh
Purpose: Imports data from a v2 export file into Apicurio Registry 3.x deployment.
What it does:
- Validates the import ZIP file
- Checks Apicurio Registry 3.x accessibility and version
- Imports all data from the export file
- Verifies artifact count after import
- Reports global rules configuration
Usage (interactive):
./apicurio-import-registry-data.sh
./apicurio-import-registry-data.sh
Usage (automated):
Environment variables:
| Variable | Description |
|---|---|
|
|
Registry base URL (for example, |
|
|
API version to use (default: |
|
|
Set to |
|
| OAuth2 token endpoint URL |
|
| OAuth2 client ID |
|
| OAuth2 client secret |
|
|
Import file path (default: |
|
|
Set to |
Important notes:
- Import adds to existing data (does not replace)
- Script warns if registry already contains artifacts
- Import into an empty v3 registry for best results
Script: apicurio-verify-registry-version.sh
Purpose: Verifies the version and health of a Apicurio Registry deployment.
What it checks:
- Health endpoint (200 OK)
- System information retrieval
- Version verification (2.x or 3.x)
Usage (interactive):
./apicurio-verify-registry-version.sh
./apicurio-verify-registry-version.sh
Usage (automated):
Environment variables:
| Variable | Description |
|---|---|
|
|
Registry base URL (for example, |
|
|
Registry version to test (default: |
|
|
Set to |
|
| OAuth2 token endpoint URL |
|
| OAuth2 client ID |
|
| OAuth2 client secret |
|
|
Set to |
Exit codes:
-
0- All checks passed -
1- One or more checks failed
Script: apicurio-verify-v3-api-features.sh
Purpose: Verifies that v3-specific API features are available and functioning correctly.
What it tests:
-
v3 system endpoints (
/system/info,/system/limits) -
v3 search endpoints (
/search/groups,/search/versions) - Admin endpoints
Usage (interactive):
./apicurio-verify-v3-api-features.sh
./apicurio-verify-v3-api-features.sh
Usage (automated):
Environment variables:
| Variable | Description |
|---|---|
|
|
Registry base URL (for example, |
|
|
Set to |
|
| OAuth2 token endpoint URL |
|
| OAuth2 client ID |
|
| OAuth2 client secret |
|
|
Set to |
Exit codes:
-
0- All feature tests passed -
1- One or more feature tests failed
Configuring authentication
All scripts support OAuth2 authentication using client credentials grant type.
Interactive mode (prompts):
If environment variables are not set, scripts prompt for:
- Auth token endpoint URL
- Client ID
- Client secret (hidden input)
Automated mode (environment variables):
For automation, set these environment variables:
export AUTH_ENABLED="true" export AUTH_TOKEN_URL="https://keycloak.example.com/realms/registry/protocol/openid-connect/token" export AUTH_CLIENT_ID="admin-client" export AUTH_CLIENT_SECRET="your-secret"
export AUTH_ENABLED="true"
export AUTH_TOKEN_URL="https://keycloak.example.com/realms/registry/protocol/openid-connect/token"
export AUTH_CLIENT_ID="admin-client"
export AUTH_CLIENT_SECRET="your-secret"
Unauthenticated deployments:
If your Apicurio Registry does not use authentication:
export AUTH_ENABLED="false"
export AUTH_ENABLED="false"
Alternatively, press Enter when prompted for authentication.
Configuring TLS/HTTPS support
Production (trusted certificates):
The scripts use trusted certificates by default. To configure this explicitly:
export SKIP_TLS_VERIFY="false"
export SKIP_TLS_VERIFY="false"
Development (self-signed certificates):
For testing with self-signed certificates:
export SKIP_TLS_VERIFY="true"
export SKIP_TLS_VERIFY="true"
Use SKIP_TLS_VERIFY=true only in non-production environments.
Troubleshooting scripts
Issue: "Failed to obtain access token"
Solution:
-
Verify
AUTH_TOKEN_URLis correct. - Check that client credentials are valid.
-
Confirm the client has appropriate roles (for example,
sr-admin). - Test manually with curl.
Issue: "Registry is not accessible"
Solution:
-
Verify
REGISTRY_URLis correct. - Check network connectivity.
- Confirm the registry is running and healthy.
- Verify firewall and security group rules.
Issue: "Export file is too small"
Solution:
- Check that authentication is working.
- Verify admin permissions.
- Review registry logs for errors.
- Confirm the export endpoint is accessible.
Issue: "Import failed"
Solution:
-
Verify the export file is a valid ZIP:
unzip -t registry-export.zip - Check that registry v3 has sufficient storage.
- Review registry v3 logs for errors.
- Confirm registry v3 is healthy before import.
Issue: "Artifact count mismatch"
Solution:
- Wait a few seconds after import (processing delay).
- Check import logs for errors.
- Verify export file integrity.
- Consider re-exporting and re-importing.
10.1. Installing dependencies リンクのコピーリンクがクリップボードにコピーされました!
All scripts require:
-
bash(version 4.0+) -
curl -
jq(for JSON parsing) -
unzip(optional, for ZIP validation)