[SOLVED] HOW TO BACKUP PROXMOX CONFIGURATION FILES.

fabiooreff

Member
Dec 9, 2019
11
12
8
28
Tortosa
Hi everyone! I had a series of doubts regarding PVE, I wanted to make a script in order to backup the Proxmox configuration files, on the Proxmox Wiki, they explain that it is recommended to backup the /etc/pve /etc/network/interfaces /etc/passwd and /etc/resolv.conf.

My question is, if I physically backup these directories, do I have enough to restore the PVE config prior to a supposed "critical failure" of the system, is it necessary to backup any other directory?
 
* In principle all configuration of the guests/storages/replication/HA/firewall resides in '/etc/pve'.
* You need to make sure to also backup the guests' disks (e.g. by running vzdump regularly)

Apart from that PVE is based on Debian GNU/Linux - so all files needed to restore a Linux System (more specifically a Debian system) are also needed from your PVE host
e.g. if you backup /etc/passwd you should probably also backup /etc/shadow, /etc/group ....

The best backup is a tested one - so if you somehow can squeeze it in - try restoring a node from your backup (to a temporary node) and see if everything starts up as expected - then you know that it'll work also in case of a 'critical failure'

I hope this helps!
 
Yes, I am already doing deployments of the copy to verify that I can restore the Proxmox configuration, surely your information will help me! The objective of the post, was that someone who had previous experience with this backup, would confirm to me if there really are more routes to back up than the Proxmox Wiki says.

Thank you very much for your reply! See if someone who has tried it can confirm that it works well, even so I have already started testing.
 
  • Like
Reactions: Stoiko Ivanov
I confirm that by making a backup of the named routes both in the wiki and in my post (which are the same), you can restore the metadata configuration of the PVE server without problems!

Hey! Did you make a useful script then?

Thanks!
 
It would be good to understand exactly what was backed up (full list of folders/files), and the procedure used to backup and then restore the node.

Thanks!
 
  • Like
Reactions: Roopee
It would be good to understand exactly what was backed up (full list of folders/files), and the procedure used to backup and then restore the node.

Thanks!

Yes, that's exactly what I am looking for!

I found a nice backup script on github if you’re interested

Link: https://github.com/DerDanilo/proxmox-stuff

Thanks. I will check it.

Edit: script seems very good but I don't know if restore all /etc/ folder is a good practice. You may need to change a hardware component (i.e.: HDD) due to failure and files inside /etc/pve files won't be fully valid (if I am not wrong). Anyway, if you keep the same hardware, it will be valid.

Thanks again!
 
Last edited:
  • Like
Reactions: Roopee
Hey! Did you make a useful script then?

Thanks!

Hi again, everybody! I see there were some doubts around here, yes, I did indeed check that the bash script I wrote works. For those who are interested, it is not a big deal, in fact on the Proxmox Wiki this option is given as valid if you intend to restore all the server configuration, basically what I do is copy the / etc / pve routes ( here are basically all the files that shape the Proxmox configuration), / etc / network / interfaces (to have the network configuration already written, this way you just have to relocate the old file in the original path and that's it) and then the files / etc / passwd / etc / group / etc / shadow (to keep the list of users and original groups in terms of PAM authentication. In response to the fact that if you change the physical hardware it may not go well, It is correct, but also uncertain, it really does not matter, since proxmox will map your configuration in the GUI in the same way you had it before, and afterwards with all the mapping in the GUI it is just a question of "reconfiguring" the physical hardware ma way It's convenient, but it's certainly faster than installing proxmox and restoring all vzdump.

Even though here I am going to say the same thing that it says in the proxmox Wiki, this type of backup makes a lot of sense when you run all the information from a network location, for example NFS or Ceph, since the machines will already start right after restore the configuration, if not, it is still useful to have your previous configuration quickly, the compression format I use is tar.gz.
 
Hi again, everybody! I see there were some doubts around here, yes, I did indeed check that the bash script I wrote works. For those who are interested, it is not a big deal, in fact on the Proxmox Wiki this option is given as valid if you intend to restore all the server configuration, basically what I do is copy the / etc / pve routes ( here are basically all the files that shape the Proxmox configuration), / etc / network / interfaces (to have the network configuration already written, this way you just have to relocate the old file in the original path and that's it) and then the files / etc / passwd / etc / group / etc / shadow (to keep the list of users and original groups in terms of PAM authentication. In response to the fact that if you change the physical hardware it may not go well, It is correct, but also uncertain, it really does not matter, since proxmox will map your configuration in the GUI in the same way you had it before, and afterwards with all the mapping in the GUI it is just a question of "reconfiguring" the physical hardware ma way It's convenient, but it's certainly faster than installing proxmox and restoring all vzdump.

Even though here I am going to say the same thing that it says in the proxmox Wiki, this type of backup makes a lot of sense when you run all the information from a network location, for example NFS or Ceph, since the machines will already start right after restore the configuration, if not, it is still useful to have your previous configuration quickly, the compression format I use is tar.gz.

Hey!

Thank you for your deep analysis! You followed a similar procedure to proxmox-stuff git that @bootsie123 sent above.

It's very useful for who are searching for a correct backup procedure as me.
 
I confirm that by making a backup of the named routes both in the wiki and in my post (which are the same), you can restore the metadata configuration of the PVE server without problems!
Hi, I tried the same thing you describe. I've copied the /etc/pve folder to my new server and when I try to restart the service pve-cluster.service, it refuses to start with some "Connection refused" errors. Any idea what could cause that? Also, where inthe wiki did you find your information on what was needed to be backed up regarding configuration?

Thanks
 
Has anyone used zfs to backup and restore a proxmox-ve server? I only have a small business and I am running ZFS on my Server and on my Workstation. I am planing to upgrade my workstation with 8TB-10TB Disks and use it as a backup destination.

I use zfs-auto-snap as snapshot tool and I've modified zfs-replicate to work with Ubuntu (ignore a warning message of zfs create)

Snapshot Script I am using.
https://github.com/zfsonlinux/zfs-auto-snapshot

My zfs-replicate (Fork)
https://github.com/LordH3lmchen/zfs-replicate

Pull request isnt merged yet. I'm testing it currently. If it gets accepted it will be in the pypi I hope.

It should be faster than old school tar.
 
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. I'm sure the configuration is more complexe than a IPBX, but I think their method can be a start point.
we would all feel much more secure if we knew that with our backup file and our ISO, we could restore our servers.
 
* In principle all configuration of the guests/storages/replication/HA/firewall resides in '/etc/pve'.
* You need to make sure to also backup the guests' disks (e.g. by running vzdump regularly)

Apart from that PVE is based on Debian GNU/Linux - so all files needed to restore a Linux System (more specifically a Debian system) are also needed from your PVE host
e.g. if you backup /etc/passwd you should probably also backup /etc/shadow, /etc/group ....

The best backup is a tested one - so if you somehow can squeeze it in - try restoring a node from your backup (to a temporary node) and see if everything starts up as expected - then you know that it'll work also in case of a 'critical failure'

I hope this helps!
excuse me @Stoiko Ivanov , when you says : " backup /etc/password , /etc/shadow " etc .... means you must do a scp copy or a backup from proxmox GUI ?
 
excuse me @Stoiko Ivanov , when you says : " backup /etc/password , /etc/shadow " etc .... means you must do a scp copy or a backup from proxmox GUI ?
the thread (and my reply) deals with creating backups of a Proxmox VE hypervisor - via cli (so in that case rsync/scp) - the PVE GUI does not (yet) have this functionality
 
  • Like
Reactions: xigloo
basically what I do is copy the / etc / pve routes ( here are basically all the files that shape the Proxmox configuration), / etc / network / interfaces (to have the network
... and optional will be the rrd folder (so you can have the graphics history) from /var/lib/rrd (i do not have a server around, and maybe I forget the path), and also /var/log (maybe you will need to investigate a past incident). Anothers candidates (good to keep): /var/spool/cron, and all /etc/cron*

Good luck / Bafta!
 

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!