Restore files to disk VM

mosczq

Member
Jan 26, 2021
14
0
6
29
Hello,


I have a question. Can I restore selected files from the GUI and/or CLI to the disk of the affected machine?
At this point, I can select files through the GUI and download them to the desktop. This solution is not efficient. Is there perhaps only such a solution?


DE:

Ich habe eine Frage. Kann ich ausgewählte Dateien über die grafische Benutzeroberfläche und/oder die Befehlszeilenschnittstelle auf der Festplatte des betroffenen Rechners wiederherstellen?

Zum jetzigen Zeitpunkt kann ich Dateien über die grafische Benutzeroberfläche auswählen und auf den Desktop herunterladen. Diese Lösung ist jedoch nicht effizient. Gibt es vielleicht nur eine solche Lösung?
 
Hi,

I'm not exactly sure if I understood you correctly; do you mean if there is a way to access the filesystem of a backed up VM disk from the PBS GUI, in order to access individual files? I'm afraid this is not possible at the moment.

On the CLI, you can use the proxmox-file-restore tool [1].

https://pbs.proxmox.com/docs/command-syntax.html#proxmox-file-restore
 
  • Like
Reactions: noel.
Am I understanding correctly that you want to are on a proxmox host and want to move files from a vm to the host? Or do you want to move files from the host to the vm? you can do either with scp or rsync. How to use scp and rsync is outside of the scope of a forum answer but there are many resources online. The base idea of scp is, you can copy files over the network from one machine to another. rsync does the same but, when you update files and send them again, only the differences are sent.
 
I want from PVE (Resource backup pbs) to click Restore file and restore the selected file/data to the machine disk.

Or do it via the CLI.

1674132709967.png
 
AFAIK your usecase is not supported out of the box.
What you could do is write a script that uses the proxmox-file-restore tool to restore the directory locally first, and then uses scp or rsync to copy it into the running VM.

Alternatively, the proxmox-backup-client map command allows you to map a VM backup as a local loopback device that you can mount to a directory and then copy from there.
 
I don't know if this post is still active, but I wanted to share my experience with a similar issue. I was finally able to mount a point-in-time backup at a mount point /media/restore. Below is the reference I used, employing the "guestmount" command (it is not installed by default, you need to install it).

Original Post: https://community.nethserver.org/t/howto-restore-a-single-file-from-proxmox-backup-server-pbs/17302

What I did:List backups:proxmox-backup-client snapshot list --repository 1.1.1.1:pbs

Mount VM disk. This mounts the disk to a loop device:proxmox-backup-client map vm/4001/2024-08-19T16:45:05Z drive-scsi0.img --repository 1.1.1.1:pbs

Mount the loop device to a folder:
  1. If it’s an LVM disk, first run the command: lvscan
  2. If the previous command shows information, enable the LVM with the command: vgchange -ay
  3. Install “guestmount” if it is not already installed
  4. Now you can mount the disk using the command: guestmount -m /dev/centos/root -r -a /dev/loop0p2 /media/restore
  5. Now you have the backed up disk of your vm mounted on the folder /media/restore and you can copy files out as normal.
NOTES:
  1. /dev/centos is a device name that may change. Make sure to check what the lvscan command returns
  2. /media/restore is a mount point that can be any directory you define
To unmount everything:
  1. umount /media/restore
  2. vgchange -an /dev/centos
  3. proxmox-backup-client unmap /dev/loop0
NOTES: /media/restore, /dev/centos, /dev/loop, and /dev/loop0p2 are paths that may change in your case.
 

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!