[SOLVED] HOW TO BACKUP PROXMOX CONFIGURATION FILES.

Just if anyone finds this useful: In addition to having full tar backups, I like to track changes of important files in git, so I have a full history.

  • Install git. I did this on the host.
  • setup repo with:
  • filelist.txt containing all the files that you want to track, e.g.:
    Code:
    # container configs
    /etc/pve/lxc/100.conf
    /etc/pve/lxc/102.conf
    /etc/pve/lxc/103.conf
    
    # storage config
    /etc/pve/storage.cfg
    
    # user config
    /etc/pve/user.cfg
    
    # special files
    /etc/pve/.vmlist
    /etc/pve/.version
    /etc/pve/.members
    /etc/pve/status.cfg
    
    # docker mod
    /etc/modules-load.d/modules.conf
    
    # apt sources
    /etc/apt/sources.list.d/pve-enterprise.list
  • get-files.sh, for updating files from sources, reproducing full paths in the repo, e.g.:
Code:
#!/bin/bash

################################################################################
#
# Shell script to copy important configuration files from the current
# environment to this repository.
#
################################################################################

# Exit as soon as a command fails
set -e

# Accessing an empty variable will yield an error
set -u

# Full path to repo directory
REPO_PATH="/backups/configs/proxmox/"

# copy all files from filelist.txt, excluding comments, recreate all paths on target directory
grep -e '^[^#]' "$REPO_PATH/filelist.txt" | xargs cp --parents --target-directory "$REPO_PATH"

echo "Completed."
  • run with bash get-files.sh

Nothing brilliant but works.
 
Last edited:
Agree, Comporder1. Very strange that there are build-in options to backup and replicate VM's, LXC, etc, but not the Proxmox host. Now facing the second time Proxmox installation suddenly broke, no way to recover it but a complete reinstall.
I am considering to switch to proxmox, but not until I can figure out how to do a scheduled backup of the host so that I can easily and quickly do a bare-metal restore.

It blows my mind that this does not exists in proxmox......
 
You can do that manually using the proxmox-backup-client + proxmox backup server using CLI or you could create a clonezilla stick for that if you want some UI.
 
You can do that manually using the proxmox-backup-client + proxmox backup server using CLI or you could create a clonezilla stick for that if you want some UI.
My understanding has been that the proxmox backup client only backs up the VMs and not the host itself. I may be totally wrong.
 
You can use the proxmox-backup-client to backup any filesystem or block device. PVEs root folder on file level or complete physical HDDs/SSDs on block level (like you system disks) included.
 
it would be very nice if we have the option to backup the host directly in the Dashboard, and the option to restore it when booting from Proxmox ISO, like 3CX do
Agree
  • The VM's like 3cx & pfsense have the option to readily backup / restore their configuration.
  • Proxmox can easily be used to take a snapshot or clone a VM
  • Both options minimize the risks / decreasing the cost of doing and possibly reverting updates.

Proxmox host has neither of these and as a result updates to Proxmox host has a far higher potential cost and there for system risk. To reduce this risk I would really like to see Proxmox have the ability to
  • Back up and restore Proxmox hypervisor configuration
  • Proxmox hypervisor snap shot and revert
Technically I do not know if either is actually possible, but that does not change the desirability of the functionality.

This feature request is a start, adding some of the functionality for the Proxmox kernel https://bugzilla.proxmox.com/show_bug.cgi?id=3761
 
Last edited:
@Helmut101

Big thanx to Helmut101 for sharing his idea. I expanded on his and want to pay it back. Here is my filelist.txt I really hope I never need to use this as I really don't know how to "RESTORE" with this. At least I will have config files to dig thru.

# CONTAINERS configs
/etc/pve/lxc/102.conf
/etc/pve/lxc/301.conf
/etc/pve/lxc/302.conf
/etc/pve/lxc/303.conf
/etc/pve/lxc/501.conf
/etc/pve/lxc/505.conf

# VM configs
/etc/pve/nodes/proxmox/qemu-server/100.conf
/etc/pve/nodes/proxmox/qemu-server/101.conf

# storage config
/etc/pve/storage.cfg

# user config
/etc/pve/user.cfg

# special files
/etc/pve/.vmlist
/etc/pve/.version
/etc/pve/.members
/etc/pve/status.cfg
/etc/pve/jobs.cfg
/etc/fstab
/etc/network/interfaces

# docker mod
/etc/modules-load.d/modules.conf

# apt sources
/etc/apt/sources.list.d/pve-enterprise.list

















Just if anyone finds this useful: In addition to having full tar backups, I like to track changes of important files in git, so I have a full history.

  • Install git. I did this on the host.
  • setup repo with:
  • filelist.txt containing all the files that you want to track, e.g.:
    Code:
    # container configs
    /etc/pve/lxc/100.conf
    /etc/pve/lxc/102.conf
    /etc/pve/lxc/103.conf
    
    # storage config
    /etc/pve/storage.cfg
    
    # user config
    /etc/pve/user.cfg
    
    # special files
    /etc/pve/.vmlist
    /etc/pve/.version
    /etc/pve/.members
    /etc/pve/status.cfg
    
    # docker mod
    /etc/modules-load.d/modules.conf
    
    # apt sources
    /etc/apt/sources.list.d/pve-enterprise.list
  • get-files.sh, for updating files from sources, reproducing full paths in the repo, e.g.:
Code:
#!/bin/bash

################################################################################
#
# Shell script to copy important configuration files from the current
# environment to this repository.
#
################################################################################

# Exit as soon as a command fails
set -e

# Accessing an empty variable will yield an error
set -u

# Full path to repo directory
REPO_PATH="/backups/configs/proxmox/"

# copy all files from filelist.txt, excluding comments, recreate all paths on target directory
grep -e '^[^#]' "$REPO_PATH/filelist.txt" | xargs cp --parents --target-directory "$REPO_PATH"

echo "Completed."
  • run with bash get-files.sh

Nothing brilliant but works.
 
@Helmut101

Big thanx to Helmut101 for sharing his idea. I expanded on his and want to pay it back. Here is my filelist.txt I really hope I never need to use this as I really don't know how to "RESTORE" with this. At least I will have config files to dig thru.

# CONTAINERS configs
/etc/pve/lxc/102.conf
/etc/pve/lxc/301.conf
/etc/pve/lxc/302.conf
/etc/pve/lxc/303.conf
/etc/pve/lxc/501.conf
/etc/pve/lxc/505.conf

# VM configs
/etc/pve/nodes/proxmox/qemu-server/100.conf
/etc/pve/nodes/proxmox/qemu-server/101.conf

# storage config
/etc/pve/storage.cfg

# user config
/etc/pve/user.cfg

# special files
/etc/pve/.vmlist
/etc/pve/.version
/etc/pve/.members
/etc/pve/status.cfg
/etc/pve/jobs.cfg
/etc/fstab
/etc/network/interfaces

# docker mod
/etc/modules-load.d/modules.conf

# apt sources
/etc/apt/sources.list.d/pve-enterprise.list
Thanks for getting back. I did a Restore recently when upgrading from Proxmox 6.4 to 7.1 (because I moved to ZFS, including the Hypervisor itself, which resides on a ZFS Mirror now). I noted down the steps, could share them here. It is not complicated and worked flawlessly. I also expanded my filelist over time.
 
Last edited:
  • Like
Reactions: gparrilla
about /etc/pve , the real data is a sqlite database in /var/lib/pve-cluster/config.db.

so, if you need to restore all /etc/pve (on a server with same name),
you just need to :


Code:
1 .install a new proxmox server with same name
2 .systemctl stop pve-cluster
3. cp config.db.bak /var/lib/pve-cluster/config.db
 4. reboot
 
Hi everybody.
What about the /etc/corosync folder?
If I have a cluster with several nodes, this diretory have information about the cluster.
To restore later, is necesary backup it to?
 
Hi,
How can I create hypervisor backup with fsarchiver? I use ZFS.
# df -h
Filesystem Size Used Avail Use% Mounted on
udev 12G 0 12G 0% /dev
tmpfs 2.4G 1.4M 2.4G 1% /run
rpool/ROOT/pve-1 791G 4.7G 786G 1% /
tmpfs 12G 40M 12G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
rpool 786G 128K 786G 1% /rpool
rpool/ROOT 786G 128K 786G 1% /rpool/ROOT
rpool/data 786G 128K 786G 1% /rpool/data
/dev/fuse 128M 32K 128M 1% /etc/pve
tmpfs 2.4G 0 2.4G 0% /run/user/0
What devide I have to give to fsarchiver?
 
I've seen a lot of "answers" effectively saying to just copy the /etc/pve directory from the running node, and when it dies, install PVE onto a new drive and paste the pve directory into the new one. No one has explained how to do that - you can't do it while PVE is running, and it seems you can't do it from the PVE recovery either.

Do you have to boot a live OS and do it?
 
I've seen a lot of "answers" effectively saying to just copy the /etc/pve directory from the running node, and when it dies, install PVE onto a new drive and paste the pve directory into the new one. No one has explained how to do that - you can't do it while PVE is running, and it seems you can't do it from the PVE recovery either.

Do you have to boot a live OS and do it?
You have to do it online. There are normally no files in write access in that directory while just "running" stuff.

In case you have to recover with a recovery system, the SQLite database has to be backuped and restored, as spirit already wrote in this comment.
 
  • Like
Reactions: noobs

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!