-
Notifications
You must be signed in to change notification settings - Fork 12
Revise Command
The revise command updates a bundle to conform to schema changes, normalize entity structures, and apply transformations. It's essential for migrating bundles between Gateway versions and ensuring bundle compatibility.
Note
Currently, bundle portability is supported from the older gateway releases to the latest. This may not be true when the deprecated features are no longer supported. During this phase, revise command ensures the portability by transforming the bundles as per the target gateway.
graphman revise --input <input-file>
[--output <output-file>]
[--options.<name> <value>,...]| Parameter | Description |
|---|---|
--input |
Input bundle file to revise |
| Parameter | Description | Default |
|---|---|---|
--output |
Output file for revised bundle | Standard output (console) |
--options.<name> |
Customize revise operation | See defaults below |
| Option | Default | Description |
|---|---|---|
normalize |
false |
Normalize/sanitize bundle for import |
excludeGoids |
false |
Remove GOIDs from entities (requires normalize) |
The revise command automatically:
- Updates entity structures to match current schema
- Adds new required fields with default values
- Removes deprecated fields
- Transforms field values to new formats
- Adjusts entity relationships
When normalize: true:
- Sanitizes bundle for import operations
- Removes duplicate entities
- Validates entity structures
- Applies import-ready transformations
- Optionally removes GOIDs
Revise bundle to current schema:
graphman revise --input old-bundle.json --output revised-bundle.jsonNormalize bundle for import:
graphman revise --input bundle.json --output normalized.json --options.normalize truePrepare portable bundle without GOIDs:
graphman revise --input bundle.json --output portable.json \
--options.normalize true \
--options.excludeGoids trueView revised bundle without saving:
graphman revise --input bundle.json --options.normalize trueMigrate bundle from older Gateway version:
# Export from old gateway (v10.x)
graphman export --gateway old-gw --output old-version.json
# Revise for new gateway (v11.x)
graphman revise --input old-version.json --output migrated.json
# Import to new gateway
graphman import --input migrated.json --gateway new-gwUpdate bundle to match current schema:
graphman revise --input legacy-bundle.json --output current-schema.jsonPrepare exported bundle for import:
# Export from source
graphman export --gateway source --output export.json
# Revise for import
graphman revise --input export.json --output import-ready.json \
--options.normalize true \
--options.excludeGoids true
# Import to target
graphman import --input import-ready.json --gateway targetRevise to specific schema version:
graphman revise --input bundle.json --output revised.json \
--options.schema v11.1.1 \
--options.normalize trueRevise multiple bundles:
#!/bin/bash
for file in bundles/*.json; do
output="revised/$(basename $file)"
graphman revise --input "$file" --output "$output" \
--options.normalize true \
--options.excludeGoids true
done