Skip to main content
Version: v5.7.0

opschain entity promote

Included from Basic tierassets

Promotes an entity to a new asset over the v2 EntityService.PromoteEntity. In one transaction the server creates the asset with its own id and path, pinned to the template version you name, copies the entity's properties (with an opschain_lineage entry appended) and its settings document, moves the entity's child entities under the new asset, and leaves the entity archived (an ordinary archived node: it can be edited, unarchived, deleted and restored). After commit the asset's actions generation starts exactly as for a created asset.

opschain entity promote /projects/shop/entities/orders_db --template postgres_cluster --template-version v14 --parent /projects/shop/environments/prod

The template version gets the asset create checks: it must exist in the destination's project and be unarchived, resolved and not disabled. The destination must accept assets — a project or an environment, never an entity, asset or infrastructure node. The promotion counts against the assets entitlement and asset licence limit. Re-running it against the archived entity is refused: unarchive it first. You need update and delete on the entity and update on <parent>/assets at the destination; anything else reads as not found.

The table output names the old and new nodes and how many nodes moved; -o, --output json|yaml emits the PromoteEntityResponse (oldNode, newNode, movedNodes).

Flags​

FlagMeaning
--template <code>The template code to pin (required).
--template-version <version>The template version to pin (required).
--parent <path>The new asset's parent: a project or an environment (default: the entity's parent, refused by name when it cannot hold assets).
--code <code>The new asset's code (default: the entity's code).
--server <url>Server base URL (default: the active context / OPSCHAIN_SERVER).
--auth-token <token>Admin bearer token override (default: your opschain login session, then $OPSCHAIN_ADMIN_TOKEN, then the token stored by opschain admin login).