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

Ovidiu

Renowned Member
Apr 27, 2014
324
12
83
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?
 
Last edited:
  • Like
Reactions: undertone2230
but what about all the configuration in /etc ?
and my custom scripts and stuff inside /root ?

I'm sure those 2 folders only contain the bare minimum settings of proxmox itself, right?

I assume I need to exclude /var/lib/vz (forgot it in the list above (will update it)
 
Your custom stuff is... custom handled.
I was talking about backing up for a quick restore: install from iso, copy back the needed files (from /etc/pve/qemu/*.conf and /etc/pve/lxc/*.conf), the network configuration and you are done (again, assuming you have a separate backup or external storage for VM disks).
If you really want full backup, it would be better to use a software designed for such a thing (i.e. backups), but to me the ISO install + few files restoration is a much better and quicker solution.
 
The LVM layout and configuration is created by the installer. Why would you backup some partitioning information? Maybe you will need to restore to another hard-drive with a different size.
 
Thanks, I didn't fully grasp it, hence my question :)

I was wondering too. I mean if I restore proxmox AND the VMs it doesn't really matter where I place them and as you said, maybe the new install differs in terms of partitioning... Thanks for confirming my thoughts.
 
/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`"
 
/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`"
when using this method, what would be the import/restore process?

Thanks!
 
For the Proxmox host I use rsnapshot with a nightly cron job. I backup /etc, /root/, /usr/local/, and /var. In a bare metal disaster recovery, I install Proxmox fresh and then restore the rsnapshot backups. I have done this once. so not an expert but the strategy did work. Requires some fore thought and testing before going live, such as replacing the system with different hardware. I am not using any cluster features.

Guest systems are backed up with vzdump cron jobs and also rsnapshot if a Linux guest. Restoring the guest is 1) restore the last vzdump and 2) restore the rsnapshot files if newer.

YMMV. I have not walked through any full scale disaster recovery scenarios, just partial scenarios. :)
 
Hello,
I know this is an old thread, but I wonder if since there are better/faster/easier/noob proof :rolleyes:;) way of backing up the Proxmox system itself ?
On the wiki, there is only talk about backing the VM's, not the proxmox system itself. https://pve.proxmox.com/wiki/Backup_and_Restore#_backup_modes

I'm running proxmox and 2 LXC (pihole, UniFi Controller) and 3 VM (OMV, Jeedom, HASS.IO) on a HP Microserver G8.
System and LXC and VM's are on one SSD Sata Drive (EXT4).
I didn't use ZFS as I heard that ZFS is not friend with SDD (No TRIM management)

So, is my best solution for now the rsnapshot solution of @upnort ?:
I use rsnapshot with a nightly cron job. I backup /etc, /root/, /usr/local/, and /var

or the @mir method:
/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`"

Thanks a lot !
 
I didn't use ZFS as I heard that ZFS is not friend with SDD (No TRIM management)
Meanwhile there is TRIM with ZFS.

I also would be interested in how to backup the host itself. I wrote down every command I used to setup the host, so I can redo the same install again, but that would be alot of work. My best idea is just to boot a backup LiveCD and use something like dd to store a 1:1 image of the system SSD on my NAS. That would be a safe and easy way to restore it later but it can't be automated and the server needs to stop, so the backups always would be faily old.
 
Guys,

Supposing that I have:

2 disks ext4 (HWRAID) for Proxmox and
4 disks LVM-THIN (HWRAID) for CT/VM's,

Can I just backup /etc/pve, format and install a new proxmox version to the OS disks (2 disks RAID1) and the data will be available normally?

Or I have to backup something related to LVM of the LVM-THIN of data (4 disks HWRAID)?
 
  • Like
Reactions: lixaotec

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!