Backing up proxmox (the host itself) - what and how?

While it look simple to run in a script.. it look there is not a full
backup ? As yes, /root/ is not important, the /sbin and /usr/local/, might be best to add.. If we install any package, some config end up to the /var, so having just the: /var/lib/pve-cluster/* might cause missing file ?

This look easier use than the proxmox backup software, but if direct install the .iso and no update done. If i do understand correct...
 
Found one single thread so far dealing with this question but no definitive answer so I'm opening my own. http://forum.proxmox.com/threads/21...de-quot-system-quot-partitions-(boot-and-lvm)

If I've somehow missed this information, feel free to point me towards it. I'll also happily edit the wiki if I get useful replies here.

My intention is not to talk about backup storage and target or the tool used for the backup as that depends on everyone's preferences.

My goal is:

If the worst case scenario happens and I need to completely restore a proxmox server, I want to be able to do a Bare-metal ISO install and then restore a backup, maybe change the hostname and networking configuration and have proxmox in exactly the state it was during the last backup without any VMs or containers of course.

What to backup?
Since proxmox doesn't run any DBs (right?) I thought I#d use a tool like duplicity or borgbackup or attic or whatever and backup /
Now I'm considering what to exclude from the backup. This is my list so far, any suggestions what to exclude or include?

EXCLUDE LIST
*/cache
*/cache/supercache
*/image_cache
*/lost+found
*/Maildir/.spam
*/Maildir/.Trash
*/rrd
*/tmp
*/web/serverstats
/cdrom
/dev
/initrd
/media
/mnt
/opt
/proc
/run
/srv
/sys
/usr/share/man
/var/backups
/var/cache
/var/empty
/var/lib/mysql
/var/lock
/var/log
/var/run
/var/spool
/var/webmin
/var/lib/lxc/*/rootfs/media/*
/var/lib/lxc/*/rootfs/mnt/*
/var/lib/lxc/*/rootfs/proc/*
/var/lib/lxc/*/rootfs/run/*
/var/lib/lxc/*/rootfs/sys/*
/var/lib/lxcfs/cgroup
/var/lib/vz


I'm not sure if I am excluding too much or too little, any hints are welcome please.

I found another thread: https://pve.proxmox.com/wiki/Backup_and_restore_of_LVM_data saying to use: vgcfgbackup - would that still be needed with my proposed solution above?
This has been very helpful for me. I did a slim down version of yours and here is my .pxarexlude (placed at the / directory)

Code:
/var/cache/*
/var/log/*
/var/run/*
/var/lib/lxc/*
/var/lib/lxcfs/*
/var/lib/vz/*

However, my only question is why does it skip /etc/pve? I thought it would be good to have it backed up since it contains all the important data for the cluster and node information.
 
There should be official guidance and recommendations on this.
 
I mean it's a feature not a bug. I know how and what to do but obfuscating/discouraging this is pretty discouraging choice for new users.
I was just getting at the fact that lots of e.g. feature requests come and go on this forum, by search one can see, since years, but not a single bugzilla entry. Bugzilla allows to file feature requests, also on the docs component of PVE.

If it was ever filed, there would have been an official answer and whoever finds it later can then go join the issue # there, once enough people gather there, it might even get some priority.
 
I just cannot believe that up till now there is no way from proxmox itself to backup its config and settings to be able to restore it.....
 
Is there still no way of doing this without going through a bunch of hoops? For such a solid solution, proxmox sure does have some gigantic holes in it.
 
Meh.
Sending ZFS snapshots to a safe place is nearly trivially easy if you care about restoring individual nodes.
I also care about backing up the configurations and setups of the proxmox host. There should be some GUI way of integrating this since it is rather important to the proper restoring of a guest machine. Guest machine backups are handled well but the integration for backup of host and configuration in the GUI is nonexistent.

They're working at it and it is at the top of the roadmap, but this has been the case for nearly 4 years... https://forum.proxmox.com/threads/backup-pve-using-pbs.80045/
 
Last edited:
/etc/pve is a virtual filesystem living in a sqlite3 database '/var/lib/pve-cluster/config.db' so the proper way of backing up proxmox configuration is to use the sqlite3 backup tools for this. This also means you can do it without stopping any proxmox services what so ever.
# sqlite3 /var/lib/pve-cluster/config.db ".backup /path/to/backup/config.db.`date -Isec`"

Actually, this old answer is also quite good, although I would probably prefer .dump or even better:

https://github.com/benbjohnson/litestream
 
I will definitely look into these, thank you for these. I just wish that there were a gui/official way of doing this that could just be pointed at. I have PBS set up but have to apparently blacklist a folder or something? Might go that route instead, we'll see how it goes. I appreciate the recommendations :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!