Backups and restore
Recovery points of a whole environment: back up now, restore in place or as copies.
A recovery point holds an environment's services, its volumes and a dump of each database. Scheduled points follow the backup schedule you set in the dashboard (environment, Backups); backups create takes one now. These commands never create or change a schedule.
stackblaze backups
Alias: backup
list shows the environment's recovery points with time, status and what each holds; show lists a point's databases and volumes and how it can be restored; create backs the environment up now; restore brings a point back; status follows the running restore; schedule shows the schedule (read only); delete removes a point and its data.
stackblaze backups [list]
stackblaze backups show <id>
stackblaze backups create [--only <service|database>] [--wait] [--timeout <seconds>] [--ci]
stackblaze backups restore <id> [--copy] [--database <name>] [--volume <name>] [-y] [--wait] [--timeout <seconds>] [--ci]
stackblaze backups status
stackblaze backups schedule
stackblaze backups delete <id> [-y]<id> is a recovery point from backups list; a unique prefix of it works, and so does latest (the newest completed point).
create --only <name> makes a PARTIAL point with the data of just the named services (their volumes) and databases. A partial point is never restored as a whole in place; restore its items or copy them.
restore <id> without item flags replaces EVERYTHING in the environment (services, databases, volumes): the environment is stopped first, and you confirm by typing its name. --database and --volume replace only those items in place, and the apps that own the volumes restart. --copy adds new databases and volumes next to what runs (everything in the point, or only the named items); nothing running changes.
--wait follows whole-environment restores and copies. Restores of single items run in the background.
| Flag | Description |
|---|---|
--only <name> | create: back up only this service or database (repeatable, or comma-separated) |
--copy | restore: add copies instead of replacing |
--database <name> | restore: only this database (repeatable, or comma-separated) |
--volume <name> | restore: only this volume, by PVC or volume name (repeatable, or comma-separated) |
--wait | create, restore: wait until it finishes (exit 1 if it fails) |
--timeout <seconds> | create: maximum --wait time (default 1800); restore: default 2700 |
--ci | create, restore: print NDJSON events |
-y, --yes | restore, delete: skip the confirmation prompt |
Also accepts the scope flags (-p, --project, -e, --env, -a, --app) and the output flags (-o, --output, --json), plus --token, --api-url and --org. Common flags
Examples
stackblaze backups create --wait
stackblaze backups create --only web --only web-postgresql
stackblaze backups list
stackblaze backups restore latest --copy --database web-postgresql
stackblaze backups restore <id> --volume data -y
stackblaze backups restore <id> --wait -e staging