Longhorn — Backup & Restore Volumes
1. Prerequisites
Longhorn installed and healthy (longhorn-system pods ready).
A Backup Target reachable from all Longhorn manager pods:
S3-compatible bucket (with access/secret and optional custom endpoint), or
NFS export (read/write, stable network).
Sufficient free space on the BackupStore.

2.Set the Backup Target
UI (recommended)
Open Longhorn UI → Settings → General.
Set Backup Target (examples):
S3: s3://my-bucket@us-east-1/longhorn
NFS: nfs://10.0.0.20:/export/longhorn-backups
- If using S3, set Backup Target Credential Secret (Access Key, Secret, Region, Endpoint if non-AWS).
kubectl (advanced)
- Create a Secret with S3 creds in longhorn-system, then patch Settings (keys vary by version). In most cases the UI is simpler and safer.
3. Create Snapshots & Backups
Manual (per volume)
Longhorn UI → Volumes → click your volume.
Snapshots tab → Create Snapshot (name it).
Backups tab → Create Backup from the snapshot (or directly “Backup”).
Recurring (recommended)
Per volume → Recurring Jobs:
- Hourly/Daily Snapshot (e.g., keep last 7)
- Daily/Weekly Backup (e.g., keep last 30)
Attach the recurring job(s) to the volume (or set globally and opt-in).
4. Verify Backups
UI
Volume → Backups tab → you should see backup entries with timestamps and sizes.
Click a backup to view details (labels, CRC, etc.).
Best practice
- Periodically restore a backup to a scratch/test volume and run a quick read/write check.
5. Restore a Backup (New Volume)
UI
Longhorn UI → Backups (left menu).
Choose the Backup Volume (it groups backups by original volume).
Pick the desired Backup → Restore.
Set New Volume Name, size (auto from backup), Data Engine, # of replicas, and (optional) Create PV/PVC.
Click OK. Longhorn creates the volume and starts rebuilding replicas.
When the volume is Healthy, Attach it to a node, then mount it via your workload (or use the auto-created PVC).
Notes
If you created PV/PVC automatically, just point your Pod/Deployment/StatefulSet to that PVC.
File system (ext4/xfs) will match the original backup unless you override.
6. Disaster Recovery (Cross-cluster or Failover)
DR Volume approach
On the target cluster, configure the same Backup Target.
Longhorn UI → Backups → select the source Backup Volume.
Click Create Disaster Recovery Volume (DR Volume).
Longhorn creates a DR volume that periodically pulls incremental backups.
If the source cluster goes down, Activate the DR volume:
DR Volume → Activate → it becomes a regular volume.
Attach, and use like normal.
When to use
- For warm standby and faster RTO than restoring from scratch.

