convex-migrate-rehearse

Rehearse Convex schema changes and backfills on snapshot-seeded preview deployments before promoting to production.

9.4k|1.5k|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/openclaw/clawhub --skill convex-migrate-rehearse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-migrate-rehearse
Source: https://github.com/openclaw/clawhub/tree/main/.agents/skills/convex-migrate-rehearse
Command: npx skills add https://github.com/openclaw/clawhub --skill convex-migrate-rehearse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @convex-dev/migrations.

What problem does it solve?

Convex validates every existing document against a new schema and fails the push if any row does not conform, so pushing an untested schema change directly to production risks a failed deploy or broken data. This Skill turns a preview deployment into a rehearsal copy seeded with a production snapshot, letting the conformance gate fail safely on the copy before the proven change is promoted to prod.

Core Features & Use Cases

  • Snapshot-seeded rehearsal: Export production data with npx convex export, create a preview deployment from pre-change code, and import the snapshot so the schema gate fails on the copy instead of prod.
  • Ordered migration workflow: Follow the optional-field-first pattern, run batched backfills via @convex-dev/migrations, then tighten validators, verifying each push on the preview.
  • Guarded promotion with rollback: Promote only after explicit confirmation, repeating the proven sequence on prod while keeping the snapshot as a rollback artifact.
  • Use Case: When adding a required field to a live Convex table, rehearse the schema change and backfill on a preview deployment seeded with real data, verify the app functions against migrated rows, then promote to production with a known-good run.

Quick Start

Ask the agent to rehearse my Convex schema change and backfill on a preview deployment seeded with a production snapshot before promoting it to prod.

Frequently Asked Questions about convex-migrate-rehearse

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely migrate a Convex schema on a live production app?

Rehearse the change on a preview deployment seeded with a production snapshot: export prod data, create the preview from pre-change code, import the snapshot, then push the optional-field schema, run the backfill, and tighten validators. Promote the proven sequence to prod only after explicit confirmation.

Why does my Convex schema push fail on existing data?

Convex validates every existing document against the new schema and fails the push if any row does not conform. Make the new or changed field optional first, backfill all rows with @convex-dev/migrations, then tighten the validator so the gate passes.

Can I create a Convex preview deployment without a deploy key?

No. Preview deployments require a Preview Deploy Key exported as CONVEX_DEPLOY_KEY, and this is a paid-tier feature. Without one, fall back to rehearsing on your personal dev deployment seeded with the snapshot.

How do I roll back a Convex migration if something goes wrong?

Keep the pre-migration production snapshot as the rollback artifact and restore it with npx convex import snapshot.zip --replace --prod. Note that data written after the snapshot is lost, so keep the promote window short.

Should I run a Convex backfill as a one-shot mutation?

No. Backfills should go through @convex-dev/migrations, which provides batched, resumable, and dry-runnable migration runs. Ad-hoc one-shot mutations over a whole table risk timeouts and partial updates.