Backup
A no-nonsense way to safely backup your
This is safe to execute on a running node and is only necessary on any single node of the cluster, the results (at specific point in time) will be exactly the same.
Obviously, it makes more sense to save this somewhere else than the home directory
Recovery
You will ideally never need to recover from this backup. In case of single node's corrupt config database, you are best off to copy over
However, failing everything else, you will want to stop cluster service, put aside the (possibly) corrupt database and get the last good state back:
NOTE: Any leftover WAL will be ignored.
[1] https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs)
A no-nonsense way to safely backup your
/etc/pve
files (pmxcfs [1]) is actually very simple:
Bash:
sqlite3 /var/lib/pve-cluster/config.db .dump > ~/config.dump.$(date --utc +%Z%Y%m%d%H%M%S).sql
This is safe to execute on a running node and is only necessary on any single node of the cluster, the results (at specific point in time) will be exactly the same.
Obviously, it makes more sense to save this somewhere else than the home directory
~
, especially if you have dependable shared storage off the cluster. Ideally, you want a systemd timer, cron job or a hook to your other favourite backup method launching this.Recovery
You will ideally never need to recover from this backup. In case of single node's corrupt config database, you are best off to copy over
/var/lib/pve-cluster/config.db
(while inactive) from a healthy node and let the implantee catch up with the cluster.However, failing everything else, you will want to stop cluster service, put aside the (possibly) corrupt database and get the last good state back:
Bash:
systemctl stop pve-cluster
killall pmxcfs
mv /var/lib/pve-cluster/config.db{,.corrupt}
sqlite3 /var/lib/pve-cluster/config.db < ~/config.dump.<timestamp>.sql
systemctl start pve-cluster
NOTE: Any leftover WAL will be ignored.
[1] https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs)
Last edited: