How to Migrate from Rudder CLI Spec v0.1 to v1 Beta
- free
- growth
- enterprise
7 minute read
This migration guide helps you migrate your Rudder CLI project from spec version 0.1 to v1.
Overview
rudder/v1 is a comprehensive redesign of the original rudder/v0.1 spec format. It improves consistency across resource kinds, replaces ambiguous field names, adopts snake case conventions, and moves to compact URN-style references throughout.
When you run the migrate command, Rudder CLI automatically rewrites the spec files present in the specified location and applies changes related to:
- Spec version upgrades
- Rename resource kinds
- Using compact URN references
- Updating property and custom type definitions
- Updating Tracking Plan rules
- Updating variant definitions
- Updating import metadata
- Updating event stream source references
As the migration process rewrites the spec files in place, RudderStack recommends committing or backing up your project before running themigratecommand.
Run the migration
To migrate your project automatically, run the following command:
rudder-cli migrate --location <path-to-project>Breaking changes
The following sections list the breaking changes introduced in the spec format upgrade from v0.1 to v1.
Themigratecommand automatically handles these changes.
Update the version field
The field-name, convention, and reference changes in rudder/v1 break the existing spec contract. The version is bumped to signal the new contract, so tooling and validation can distinguish it from legacy spec version rudder/v0.1.
version: rudder/v1version: rudder/0.1
# or
version: rudder/v0.1Rename the Tracking Plan kind
The Tracking Plan kind changes from tp to tracking-plan. The abbreviated tp was an opaque abbreviation, while tracking-plan is self-documenting and consistent with how the resource is named everywhere else.
version: rudder/v1
kind: tracking-planversion: rudder/v0.1
kind: tpCompact URN references
All cross-resource references change from the path-based format (#/<kind>/<group>/<id>) to the compact URN format (#<resource-type>:<id>). Path-based references were verbose and order-dependent, while compact URNs are shorter and encode the resource type, making references unambiguous and easier to read.
The following table lists the updated reference format for each resource type:
| Resource | v0.1 | v1 |
|---|---|---|
| Property | #/properties/group/prop_id | #property:prop_id |
| Event | #/events/group/event_id | #event:event_id |
| Category | #/categories/group/cat_id | #category:cat_id |
| Custom type | #/custom-types/group/type_id | #custom-type:type_id |
| Tracking plan | #/tp/group/tp_id | #tracking-plan:tp_id |
The following example shows an event referencing a category:
version: rudder/v1
kind: events
spec:
events:
- id: api_tracking
name: API Tracking
event_type: track
category: "#category:user_actions"version: rudder/v0.1
kind: events
spec:
events:
- id: api_tracking
name: API Tracking
event_type: track
category: "#/categories/app_categories/user_actions"Updated property definitions
Property definitions undergo four changes:
propConfigis renamed toconfigfor brevity and consistency with other resource field namingconfigkeys move to snake case to align with YAML ecosystem conventionstypebecomestypes(an array) to eliminate fragile comma-separated string parsing- Array item types are hoisted to top-level to reduce nesting and make type information more discoverable
propConfig renamed to config
config:
enum: ["GET", "PUT", "POST"]propConfig:
enum: ["GET", "PUT", "POST"]config keys converted to snake case
config:
minimum: 0
maximum: 10
multiple_of: 2
min_length: 10
max_length: 64propConfig:
minimum: 0
maximum: 10
multipleOf: 2
minLength: 10
maxLength: 64Multi-type type string replaced by types array
Properties with multiple types use a types array instead of a comma-separated type string.
- id: status_code
types:
- integer
- "null"- id: status_code
type: "integer,null"Array item types hoisted to top-level
- id: tag_list
type: array
item_type: string
# Multiple item types
- id: user_scores
type: array
item_types:
- integer
- number- id: tag_list
type: array
propConfig:
itemTypes:
- stringFull property definition example
version: rudder/v1
kind: properties
metadata:
name: api_tracking
spec:
properties:
- id: api_method
name: API Method
type: string
description: "http method of the api called"
config:
enum: ["GET", "PUT", "POST", "DELETE", "PATCH"]
- id: http_retry_count
name: HTTP Retry Count
type: integer
description: "Number of times to retry the API call"
config:
minimum: 0
maximum: 10
multiple_of: 2
- id: password
name: Password
type: string
config:
min_length: 10
max_length: 64version: rudder/v0.1
kind: properties
metadata:
name: api_tracking
spec:
properties:
- id: api_method
name: API Method
type: string
description: "http method of the api called"
propConfig:
enum: ["GET", "PUT", "POST", "DELETE", "PATCH"]
- id: http_retry_count
name: HTTP Retry Count
type: integer
description: "Number of times to retry the API call"
propConfig:
minimum: 0
maximum: 10
multipleOf: 2
- id: password
name: Password
type: string
propConfig:
minLength: 10
maxLength: 64Custom type definitions
Custom type definitions undergo two changes:
$ref(a JSON Schema artifact with no semantic meaning in this context) is replaced by the clearerpropertyconfigkeys follow the same snake case convention as properties
$ref replaced by property in type properties
spec:
types:
- id: login
type: object
properties:
- property: "#property:username"
required: truespec:
types:
- id: login
type: object
properties:
- $ref: "#/properties/api_tracking/username"
required: trueConfig keys converted from camel to snake case
config:
min_length: 10
max_length: 255config:
minLength: 10
maxLength: 255Tracking Plan rules
Tracking Plan rules undergo two structural changes:
- The
eventobject wrapper was redundant, soeventnow holds a direct reference string consistent with how other references are expressed. allow_unplannedis renamed toadditional_propertiesand moved to rule level for clarity.$refis replaced bypropertyin rule properties, using compact URNs
The event object replaced with a direct reference string
The event field changes from an object (containing $ref, allow_unplanned, and identity_section) to a direct reference string. The allow_unplanned and identity_section fields move to rule level:
event.$refbecomesevent(direct string)event.allow_unplannedbecomesadditional_properties(moved to rule level and renamed)event.identity_sectionbecomesidentity_section(moved to rule level)
rules:
- type: event_rule
id: login
event: "#event:api_tracking"
additional_properties: false
identity_section: propertiesrules:
- type: event_rule
id: login
event:
$ref: "#/events/api_tracking/api_tracking"
allow_unplanned: false
identity_section: properties$ref replaced by property in rule properties
properties:
- property: "#property:username"
required: true
- property: "#property:password"
required: trueproperties:
- $ref: "#/properties/api_tracking/username"
required: true
- $ref: "#/properties/api_tracking/password"
required: trueFull Tracking Plan example
version: rudder/v1
kind: tracking-plan
metadata:
name: api_tracking
spec:
id: api_tracking
display_name: API Tracking
rules:
- type: event_rule
id: login
event: "#event:api_tracking"
additional_properties: false
properties:
- property: "#property:username"
required: true
- property: "#property:password"
required: trueversion: rudder/v0.1
kind: tp
metadata:
name: api_tracking
spec:
id: api_tracking
display_name: API Tracking
rules:
- type: event_rule
id: login
event:
$ref: "#/events/api_tracking/api_tracking"
allow_unplanned: false
properties:
- $ref: "#/properties/api_tracking/username"
required: true
- $ref: "#/properties/api_tracking/password"
required: trueVariant definitions
Variants appear in both custom types and Tracking Plan rules — they undergo the following changes:
- The variant
defaultis restructured to remove an array-of-objects pattern in favor of an explicitpropertieswrapper that matches the shape used in rules - All
$reffields within variant discriminators and cases are replaced bypropertywith compact URN references
Variant default restructured from array to object
variants:
- type: discriminator
default:
properties:
- property: "#property:prop_a"
required: truevariants:
- type: discriminator
default:
- $ref: "#/properties/group/prop_a"
required: trueVariant discriminator and case properties
Variant discriminator and case properties follow the same $ref to property change.
variants:
- type: discriminator
discriminator: "#property:api_method"
cases:
- display_name: "Create Entity"
match: ["POST"]
properties:
- property: "#property:user_agent"
required: truevariants:
- type: discriminator
discriminator: "#/properties/api_tracking/api_method"
cases:
- display_name: "Create Entity"
match: ["POST"]
properties:
- $ref: "#/properties/api_tracking/user_agent"
required: trueImport metadata
The local_id field in import metadata is replaced by a urn field that includes the resource type. The urn field encodes the resource type alongside the local ID, eliminating ambiguity when multiple resource types share the same ID values.
The URN format is <resource-type>:<local-id>.
Valid resource types include:
propertyeventcategorycustom-typetracking-planevent-stream-sourceretl-source-sql-model
metadata:
name: test_props
import:
workspaces:
- workspace_id: ws-123
resources:
- urn: property:prop1
remote_id: remote-prop-1metadata:
name: test_props
import:
workspaces:
- workspace_id: ws-123
resources:
- local_id: prop1
remote_id: remote-prop-1Event stream source references
The Tracking Plan reference in event stream source governance uses the compact URN format, consistent with the unified compact URN format adopted for all cross-resource references in v1.
version: rudder/v1
kind: event-stream-source
spec:
id: test-source
name: Test Source
type: javascript
governance:
validations:
tracking_plan: "#tracking-plan:tp-abc123"version: rudder/v0.1
kind: event-stream-source
spec:
id: test-source
name: Test Source
type: javascript
governance:
validations:
tracking_plan: "#/tp/group/tp-abc123"