Skip to content
Back

How do you manage DB schema changes across dev → staging → prod?

  • 0
  • Self Hosted
  • Databases
  • Cloud
Vinoth
12 Sep, 2025, 08:26

Hi all! I’m setting up a clean workflow for incremental database changes in an Appwrite project. I have experience with Payload CMS, where changing collections/fields auto-generates migration files that we commit and run per environment. I couldn’t find a definitive Appwrite guide for this, so I’d love to hear how you handle it in practice.

Context Environments: dev → staging → prod (separate Appwrite projects). First deploy is easy enough with the CLI. After that, I want a reliable, incremental migration + seed flow.

Questions

Migrations: Do you rely on appwrite push for changes, or do you run code-first scripts with the server SDK (via CI or an admin Function)? Any gotchas with CLI diffs on attributes/indexes?

Promotion: How do you promote the same change through dev (local docker container) → staging (cloud hosted) → prod (tags, versioned scripts, Git-driven CI)?

**Expand/contract changes: **For renames/type changes, do you add new fields, backfill, then drop old later? How do you handle backfills safely at scale?

**Seeding static data: **Do you keep idempotent seed scripts (upserts) you can re-run anytime? Where do you store/run them?

Tracking: Do you keep a “migrations” collection to record which scripts ran, or another pattern?

**Rollbacks & backups: **What’s your rollback story and backup step before running migrations?

**Examples: **Any public repos, gists, or blog posts you recommend?

Thanks! If there’s an established pattern, I’ll summarize it here for others.

TL;DR
Managing DB schema changes across different environments (dev → staging → prod) for an Appwrite project: - **Migrations:** Use `appwrite push` or run code-first scripts with the server SDK. - **Promotion:** Utilize versioned scripts, Git-driven CI, and tagging to promote changes. - **Expand/contract changes:** Add new fields for changes, backfill, and safely handle backfills at scale. - **Seeding static data:** Keep idempotent seed scripts for re-runs. - **Tracking:** Consider keeping a “migrations” collection to record scripts run. - **Rollbacks & backups:**
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more