Skip to content
Tools/Nodes/migrate_type

migrate_type

Migrate every entity of one type to another, applying defaults from `UPG_MIGRATIONS`. Three passes commit as one write: (1) node rename, (2) edges through `UPG_EDGE_MIGRATIONS` (catalog-aware renames, direction flips, drops; endpoint guards check post-migration types; uncatalogued edges surface as `unmapped_legacy_edges`), (3) every node through `UPG_PROPERTY_MIGRATIONS` (top-level renames, lifts, drops, self-referential cleanup). Type-specific property rules see the post-rename type.

Nodesatomic. Single store-level migration call commits or fails as one mutation. Note: full graph canonicalisation runs as a side-effect of any node-type migration, so unrelated legacy edges may also be retargeted.

Arguments

from_typestringrequired

The current entity type to migrate FROM

to_typestringrequired

The new entity type to migrate TO

dry_runbooleanoptional

Preview changes without applying (default false)

Returns

Shape
{ migrated_nodes, migrated_edges, edge_renames, dropped_edges, unmapped_legacy_edges, defaults_applied, dry_run }
edge_renames is [{ id, from, to, flipped }]; dropped_edges is [{ id, from }]; unmapped_legacy_edges is [{ type, count }].
migrated_edges is the total mutated count (renames + drops).

Examples

Live call against the Notion example graph.

Input

{
  "from_type": "jtbd",
  "to_type": "job",
  "dry_run": true
}

Output

{
  "migrated_nodes": 0,
  "migrated_edges": 0,
  "edge_renames": [],
  "dropped_edges": [],
  "unmapped_legacy_edges": [],
  "defaults_applied": null,
  "dry_run": true
}

See Also