---
title: "Back up, restore and roll back"
description: "Take snapshots of the production deployment, the components' tables with yours, restore one and bring the billing and email providers back in step, and roll back a deploy across a schema change without breaking the data."
canonical_url: "https://nuxt-backend.dev/docs/ship/operate/backup"
---
# Back up, restore and roll back

> Take snapshots of the production deployment, the components' tables with yours, restore one and bring the billing and email providers back in step, and roll back a deploy across a schema change without breaking the data.

Version: nuxt-backend 0.6.x · Tab: Ship · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

Everything the app keeps lives in the Convex deployment: your tables, and the tables of the `backend` component and the components beside it (accounts and sessions, the billing cache, gifts, the activity trail, the webhook log). A backup of the deployment is a backup of the app. What it does not hold is the providers' side, the billing customers and the email contacts, which the providers keep and the app reads back after a restore.

## Take a backup

The Convex dashboard's **Backups** page takes a snapshot of the deployment, by hand or on a schedule, and restores it in place. From a terminal, the same snapshot is a ZIP file:

```bash
npx convex export --prod --path backups/2026-10-21.zip                          # every table, the components' among them
npx convex export --prod --include-file-storage --path backups/2026-10-21-files.zip   # with the stored files
```

A snapshot holds data, not configuration: the deployment's env is not in it. Keep production's env values in your secret store, and `npx convex env list --prod` names what the deployment holds.

Rehearse a restore once, into a dev deployment, before you need one: it is the only way to know the backup is whole.

## Restore

```bash
npx convex import --prod --replace-all backups/2026-10-21.zip
```

`--replace-all` makes the deployment hold exactly what the snapshot holds. Restoring in the dashboard does the same. Everything the app did since the snapshot is gone from the deployment, but not from the providers: what happened there in between is what to catch up.

## Bring the providers back in step

1. **Products.** Reload the catalog's products from the billing provider: `npx convex run --prod billing:syncProducts`.
2. **Events in between.** The webhooks that arrived after the snapshot were applied to data the restore replaced. Redeliver the provider events of that window from each provider's dashboard: billing subscriptions and orders, email delivery events. [Replay](https://nuxt-backend.dev/docs/ship/operate/replay) sends them from the delivery log.
3. **Entitlements.** Each billing entity's plans, features and balances refresh when its next event arrives, or when someone in it calls `useCredits().refresh()` (`syncEntitlements`). To refresh every entity at once, run `npx nuxt-backend billing resync --prod` ([`billing resync`](https://nuxt-backend.dev/docs/reference/cli#billing-resync)).
4. **Erasures.** An account erased after the snapshot is back in the deployment, though its billing customer and email contact are gone from the providers. Erase it again: `account.forget(ctx, { userId })`, from an internal mutation of yours.

Then run `npx nuxt-backend doctor --prod`.

## Roll back a deploy

The app and the backend roll back separately, and the backend's schema decides how far:

- **The app.** Roll back on your host (on Vercel, the project's Instant Rollback) when the backend still serves every function the older app calls. When it does not, roll the backend back first.
- **The backend.** Deploy the earlier commit with the same build command. Convex checks the schema against the documents already stored and refuses a push they don't match, so a rollback across a schema change that wrote new fields is refused, and nothing is lost.
- **Across a schema change.** Change the schema in steps that can each be undone: widen it first (a new field optional), migrate the documents ([Migrations](https://nuxt-backend.dev/docs/build/data/jobs/migrations)), then narrow it in a later deploy. Each deploy then has a predecessor its data still fits.
- **The package's own data.** `npx nuxt-backend deploy` and `deploy --build` run the package's data migrations once per deployment, after the push that needs them, and `npx nuxt-backend upgrade --prod --yes` runs them after any other deploy ([`upgrade`](https://nuxt-backend.dev/docs/reference/cli#upgrade)). Rolling the package back below a version whose migration ran is a restore, not a deploy: restore the snapshot you took before the upgrade.

## Related

- [Respond to incidents](https://nuxt-backend.dev/docs/ship/operate/runbooks): when the incident is a webhook, an erasure or a provider.
- [Migrations](https://nuxt-backend.dev/docs/build/data/jobs/migrations): change stored documents in batches, online.
- [Upgrade to a new version](https://nuxt-backend.dev/docs/ship/releases/upgrade): what `upgrade` changes, in the code and in the data.
- [Privacy and data inventory](https://nuxt-backend.dev/docs/ship/compliance/privacy): what each table holds, and what a restore brings back.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
