PluginBench
Skill
Pass
Audit score 90

convex-migrate

get-convex/agent-skills

Safely migrate schema and backfill data on live Convex apps without downtime.

What is convex-migrate?

Migrate deployed Convex schemas and backfill existing data using @convex-dev/migrations. Use this when you need to change your data model on a live app without breaking existing rows or causing downtime.

  • Stage schema changes by making new fields optional first
  • Write and run migrations to backfill or transform existing rows
  • Verify data integrity before tightening validators
  • Prevent validator rejections that would break live apps
  • Transform old rows to match new schema requirements

How to install convex-migrate

npx skills add https://github.com/get-convex/agent-skills --skill convex-migrate
Prerequisites
  • Existing Convex project and deployed app
  • @convex-dev/migrations package installed
Claude Code
Cursor
Windsurf
Cline

How to use convex-migrate

  1. 1.Make the new field optional in your schema
  2. 2.Install @convex-dev/migrations in your Convex project
  3. 3.Write a migration function that backfills or transforms existing rows
  4. 4.Run the migration and verify row counts match before and after
  5. 5.Tighten the validator (make the field required) once backfill completes
  6. 6.Deploy the updated schema

Use cases

Good for
  • Adding a required field to an existing table with millions of rows
  • Renaming or restructuring fields across your database
  • Changing field types while preserving existing data
  • Backfilling computed or derived values for historical records
  • Gradually rolling out schema changes to production
Who it's for
  • Backend engineers managing Convex databases
  • Full-stack developers deploying schema changes to production
  • Teams running live applications that cannot afford downtime

convex-migrate FAQ

What happens if I tighten a validator before the backfill completes?

The validator will reject existing rows that don't match the new schema, breaking your live app. Always backfill first, then tighten.

Can I use this on a live production app?

Yes, that's the purpose. The staged approach (optional → migrate → require) ensures zero downtime.

How do I verify the migration worked?

Compare row counts before and after the migration, and check that all rows now satisfy the new validator.

What if my backfill logic is complex?

Write the migration function to handle your specific transformation logic; @convex-dev/migrations runs it against all existing rows.

Full instructions (SKILL.md)

Source of truth, from get-convex/agent-skills.


name: convex-migrate description: "Migrate schema + backfill data on a deployed Convex app using @convex-dev/migrations."

<!-- GENERATED from convex-agents content/capabilities/migrate.json — do not edit by hand. -->

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.

Workflow

  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.