[SOLVED] HOW TO BACKUP PROXMOX CONFIGURATION FILES.

Dec 2, 2020
50
16
8
31
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:

cholzer

New Member
Nov 5, 2021
9
2
3
42
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......
 

Dunuin

Famous Member
Jun 30, 2020
6,715
1,556
149
Germany
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.
 
  • Like
Reactions: cholzer

samboat

New Member
Oct 7, 2021
1
0
1
31
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.
 

Dunuin

Famous Member
Jun 30, 2020
6,715
1,556
149
Germany
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.
 

patch

Member
Aug 5, 2021
44
3
8
32
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:

wudwork

New Member
Jun 30, 2022
1
1
3
@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.
 
  • Like
Reactions: Helmut101
Dec 2, 2020
50
16
8
31
@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:

kodi_ie

New Member
Jun 15, 2022
4
3
3
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.
Please do !
 

spirit

Famous Member
Apr 2, 2010
5,684
625
133
www.odiso.com
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
 
  • Like
Reactions: Helmut101

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 your own in 60 seconds.

Buy now!