Skip to content

Revisions and migration

Each blueprint has a sequence of revisions: 1, 2, 3, and so on.

  • A draft revision is saved but not in use. No record can use it. Saving your changes again makes a new draft revision. A saved draft can’t be changed or deleted; one you don’t publish simply stays unpublished.
  • A published revision is frozen. Its YAML, attributes, views, and schemas never change again.
  • The current revision is the highest published one. New records use it.

Every record is pinned to the revision it was created with, or last migrated to. Its values are validated by that revision’s rules and shown with that revision’s layout. Publishing revision 3 changes nothing for a record on revision 2 until someone migrates it.

As a result, a value keeps the meaning it had when it was written, even after the definition moves on.

In the web app, open the blueprint under Manage → Blueprints and create a new revision from the current one. With the CLI:

Terminal window
acli blueprint create-version <blueprint-id> --file product-v2.yaml
acli blueprint publish <blueprint-id> 2

The code must stay the same, and so must the reset of a generated attribute. Everything else can change.

Once a newer revision is published, records on older revisions are outdated. You can find them in several places:

  • The Explorer defaults to the current revision and shows a notice with a link to hidden older records.
  • Selecting All versions in the Explorer and sorting by the Schema column puts the oldest revisions first.
  • The record page marks an outdated record and links to its upgrade page.
  • Manage → Data health counts outdated records per blueprint.

Open the record and choose to upgrade it. Attricat compares its current values with the target revision and reports one of these outcomes:

Outcome Meaning What to do
ready Every value fits the new revision. Migrate.
needs_input The record’s values don’t fit the new revision: a newly required attribute has no value, or relationships exceed a new cardinality. Fill in or correct the values on the upgrade page, then migrate.

The target is always the current published revision. Migration copies values into the new revision, validates them, rebuilds the record’s search data, and records the migration in one step. If anything fails, nothing changes.

With the CLI:

Terminal window
acli record migrate <record-id>

When a new revision only adds optional attributes or removes attributes, and leaves record_schema and every kept attribute unchanged, the blueprint page offers Migrate compatible records. It starts a background batch that looks at every record pinned to any older revision of the blueprint. Starting it archives the values of removed attributes; they stay in value history. Each record whose migration is ready is migrated. The rest are left for review.

The blueprint’s Migrations tab lists every batch with its target revision, progress, and counts of migrated, needs-review, and failed records. While a batch for the current revision is queued or running, the action is disabled.

Batch status Meaning
queued Waiting for a worker.
running Being processed.
completed Every eligible record was examined. Some may still need review.
failed Stopped after repeated errors. Records it already migrated stay migrated.
superseded Replaced by a newer batch.

Two server settings tune batches: BLUEPRINT_MIGRATION_PAGE_SIZE and BLUEPRINT_MIGRATION_CONCURRENCY. See the configuration reference.

record migrate-bulk migrates every ready record from one source revision and reports the rest:

Terminal window
acli record migrate-bulk --blueprint product --from-version 1 --dry-run
acli record migrate-bulk --blueprint product --from-version 1

The summary groups records into ready, needs_input, and failed. Records that need input are skipped; resolve them on their upgrade pages, then run the command again.

  • Add, don’t change. A new optional attribute keeps every record ready.
  • Don’t reuse codes. If weight changes from grams to kilograms, add weight_kg and retire weight. Reusing the code makes old values look valid and wrong.
  • Loosen before you tighten. Publish a revision that adds a field, fill it in across the catalog, then publish a revision that makes it required.
  • Watch cardinality. Changing a relationship from many to one blocks every record that has more than one target.
  • Bump includes on purpose. A new mixin revision only reaches a blueprint when you publish a blueprint revision that points at it.