Migrate

by get-convex6ca54f6e2e75No licenseListed Oct 8, 2026Updated Oct 8, 2026

Safely migrate the schema + backfill data on a deployed Convex app with @convex-dev/migrations. TRIGGER when changing the schema on a live app, backfilling data, or after a schema-validation error from a change. SKIP a fresh local app.

AI-generated overview

Guides safe schema migration and data backfill on a deployed Convex app using @convex-dev/migrations.

What it does
This skill provides a step-by-step procedure for changing the schema of a live Convex application without breaking existing data. It covers staging the schema change by adding new fields as optional, installing @convex-dev/migrations, writing a backfill migration to transform existing rows, running it, and verifying row counts before tightening the validator. It produces a migration plan and backfill steps rather than code artifacts.
When to use it
Use it when changing the schema on a deployed Convex app, backfilling existing data, or after a schema-validation error caused by a change. It is not intended for a fresh local app.
Requirements
Requires a deployed Convex app and the @convex-dev/migrations package. Instructions only; no scripts are included.

Migrate the schema / data on a live app

Change a deployed schema without breaking existing data: stage the schema change, install @convex-dev/migrations, write a backfill that makes old rows valid, run it, and verify before tightening the validator.

Steps

  1. Make the new field optional first (so deploy doesn't reject existing rows).
  2. Install @convex-dev/migrations; write a migration that backfills/transforms existing rows.
  3. Run the migration; verify all rows are valid.
  4. Tighten the validator (make the field required) once the backfill is complete.

Rules

  • Never tighten a validator before the backfill completes — it rejects existing rows and breaks the live app.
  • Add new fields as optional first, migrate, then require.
  • Verify row counts before and after.

Source and attribution

Source:get-convex/convex-backend-skillinskills/migrateat commit6ca54f6

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal