Best practice for Proxmox self-backup

Hello
Thank for the script

I try to backup the server with it .
Then I try to restore to same machine but with fresh install (same version of proxmox) but pve-cluster refuses to start
I receive pmxcfs error 255

Tried to run pmxcfs I receive :
fuse: mountpoint is not empty
fuse: if you are sure it is safe , use the 'nonempty' mount option

This happenes (if i understood well) because /etc/pve is not empty (probably as it has my setup)

How to continue from there?
How to try to mount the nonempty /etc/pve ?
Thank you
 
This happenes (if i understood well) because /etc/pve is not empty (probably as it has my setup)
move your copy of /etc/pve away:
`mv /etc/pve /etc/pve.bck`
restart the pve-cluster service/pmxcfs:
`systemctl restart pve-cluster`

once this works - copy the files you need from /etc/pve.bck to /etc/pve
 
  • Like
Reactions: flames
First BIG THX to all here & esp DerDanilo, & we WILL USE this !!

adding my 2 cents

Instead of pick & choose which dir & so & such .. take the entire root fs, so, if using, gd 'ol fashioned LVM and old school way of using fsarchiver cmd line utility like this:

# create the LV snapshot of the root file system

$ lvcreate -L 10G -s -n snapROOTlabel /dev/pve/root

# run the fsarchiver util or put it into script

$ fsarchiver -j 16 -z 9 -L savethisrootfssnapshotlabel savefs ./nameoffsarchiverfsbackup.fsa /dev/mapper/pve-snapROOTlabel

# -j 16 means use 16 cores (multi threading), -z 9 means use lzma level nine compression (opting to use lzma legacy instead of something like zstd or etc .. ), -L is just labeling it ..

# get rid of the snapshot LV after thE backup script finishes ..

$ lvremove /dev/pve/snapROOTlabel
 
  • Like
Reactions: zolo32 and chriss
Does this script from DerDanilo also help after a ssd crash of the proxmox system? Means after reinstalled a new proxmox on a new ssd.

Can i re-create all VMs and CTs with the script (restore)?
 
No. Without a backup no restore.
See the github page for details
 
Can i re-create all VMs and CTs with the script (restore)?

No, the script currently doesn't have a restore function.
But the backup ist really just an archive of the backuped folders, so you can extract it and put the files of your chosing back.
E.g. the vm<ID>.conf files to recreate all your guests. Of course, the VM/container data (vol or subvols) needs to be there as well, as it is not part of this backup.

I would recommend cherry-picking the part of the configuration you put back, as a newly installed system is sometimes an opportunity for decluttering. At least for me it is.
 
First, thanks to DerDanilo for the scripts and work! I am doing backups of the PVE installation to PBS but I prefer to shut down my virtual machines when collecting the backup as I have some databases I prefer not be touched by the VM's while taking the backup.

I have added some bits and bobs to for my own needs:
  • Shutdown only the running VM's
  • Wait for the VM's to fully stop before doing the PVE system backup
  • Rsync over SSH between PVE and PBS
  • Startup only the VM's that was running before
A few other lines had also to be adapted to work over SSH.

I have only touched the 'prox_config_backup.sh' script. Perhaps someone could find some of my additions useful.
https://github.com/Lennong/proxmox-stuff/blob/master/prox_config_backup.sh
 
Last edited:
I just wrote a bash script to backup required config (quick and dirty). I will finish/adjust the script in future.
You are welcome to collaborate.

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

Hope that helps for now. I'd recommend to push the backups to an external storage via scp/sshfs or something.
I will extend the script when I have time for that.
@DerDanilo, I know this is an old post but I see that the backup script was updated a year ago. Will the backup script support configs such as SDN, Ceph (config not data), OVS switch, etc.?
 
@DerDanilo, I know this is an old post but I see that the backup script was updated a year ago. Will the backup script support configs such as SDN, Ceph (config not data), OVS switch, etc.?
The updates are commits from other contributors.
I wrote an Ansible role to backup everything in /etc (including the mounted /etc/pve in case of clusters) to a PBS.
Hence I am not using this simple bash script anymore.
Restoring server configuration is not a one click tasks, especially if hardware changed. Hence I did not put much effort into automating that.

You are welcome to open a PR with improvements.
 
  • Like
Reactions: maximash
First, thanks to DerDanilo for the scripts and work! I am doing backups of the PVE installation to PBS but I prefer to shut down my virtual machines when collecting the backup as I have some databases I prefer not be touched by the VM's while taking the backup.

I have added some bits and bobs to for my own needs:
  • Shutdown only the running VM's
  • Wait for the VM's to fully stop before doing the PVE system backup
  • Rsync over SSH between PVE and PBS
  • Startup only the VM's that was running before
A few other lines had also to be adapted to work over SSH.

I have only touched the 'prox_config_backup.sh' script. Perhaps someone could find some of my additions useful.
https://github.com/Lennong/proxmox-stuff/blob/master/prox_config_backup.sh
@Lennong please open a PR if you think that your changes are beneficial to others.
 
@Lennong please open a PR if you think that your changes are beneficial to others.
I went a bit further and rewrote the whole thing. Found out about proxmox-backup-client which helps out a great deal. When just throwing up the data we miss out on the dedup features but when using proxmox-backup-client it gets properly recognized by PBS datastore.

Wrapped a bit of shell spagetti around it to be able to control what VM's to start or stop while doing the backup:
https://github.com/Lennong/PVE-Backup/blob/main/pve-to-pbs.sh
 
  • Like
Reactions: DerDanilo

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!