| name | gcloud-backup-dr |
| description | Backup and DR Service via gcloud (`gcloud backup-dr`). Manage Backup and DR resources — backup-plan-associations, backup-plan-revisions, backup-plans, backup-vaults, backups, data-source-references, data-sources, locations. |
gcloud backup-dr — Backup and DR Service
Overview
gcloud backup-dr manages Google Cloud Backup and DR Service — centralized, policy-driven
data protection for Google Cloud workloads (Compute Engine VMs and disks, Cloud SQL, AlloyDB,
Filestore, VMware Engine, databases, and file systems). The CLI manages backup vaults with
enforced (immutable) retention, backup plans with scheduled rules, backup plan associations
that bind a plan to a protected resource, management servers (for the management console),
and restore operations. Reach for it to enforce retention policy, run scheduled or on-demand
backups, and restore protected resources. The GA surface has 40 commands across 12 groups.
Quick reference — common workflows
1. Enable the API and initialize service configuration
gcloud services enable backupdr.googleapis.com
gcloud backup-dr service-config init \
--project=MY_PROJECT \
--location=us-central1 \
--resource-type="compute.googleapis.com/Instance"
gcloud backup-dr locations list
2. Create a backup vault (enforced retention)
gcloud backup-dr backup-vaults create my-vault \
--location=us-central1 \
--backup-min-enforced-retention="p1m" \
--description="Production backup vault"
gcloud backup-dr backup-vaults list --location=us-central1
gcloud backup-dr backup-vaults describe my-vault --location=us-central1
3. Create a backup plan and associate it with a resource
gcloud backup-dr backup-plans create my-backup-plan \
--project=MY_PROJECT \
--location=us-central1 \
--resource-type="compute.googleapis.com/Instance" \
--backup-vault=my-vault \
--backup-rule="rule-id=daily-rule,retention-days=30,recurrence=DAILY,backup-window-start=2,backup-window-end=14"
gcloud backup-dr backup-plan-associations create my-bpa \
--project=MY_PROJECT \
--location=us-central1 \
--backup-plan=my-backup-plan \
--resource=projects/MY_PROJECT/zones/us-central1-a/instances/my-vm \
--resource-type="compute.googleapis.com/Instance"
gcloud backup-dr backup-plan-associations describe my-bpa --location=us-central1
4. Trigger an on-demand backup and monitor it
gcloud backup-dr backup-plan-associations trigger-backup my-bpa \
--project=MY_PROJECT \
--location=us-central1 \
--backup-rule-id=daily-rule
gcloud backup-dr operations list
gcloud backup-dr backups list --backup-vault=my-vault --location=us-central1
5. Restore a Compute Engine VM from a backup
gcloud backup-dr backups list \
--backup-vault=my-vault \
--data-source=my-data-source \
--location=us-central1
gcloud backup-dr backups restore compute BACKUP_ID \
--project=MY_PROJECT \
--location=us-central1 \
--backup-vault=my-vault \
--data-source=my-data-source \
--name=restored-vm \
--target-project=MY_PROJECT \
--target-zone=us-central1-a
6. Inspect backup protection status
gcloud backup-dr backup-plan-associations fetch-for-resource-type \
compute.googleapis.com/Instance \
--location=us-central1
gcloud backup-dr resource-backup-config list --location=us-central1
gcloud backup-dr data-sources list --backup-vault=my-vault --location=us-central1
Command groups
See index.md for a one-line index of all 40 commands.
Common flags & tips
beta / alpha
gcloud beta backup-dr and gcloud alpha backup-dr expose the same 12 command groups as GA.
Commands are marked as potentially changing without notice. Use these tiers to access pre-GA
API features; no alpha/beta-exclusive command groups exist on the current 40-command surface.
- The
--network flag on management-servers create is DEPRECATED in the GA reference —
private service access is now configured separately.
Official documentation