[SOLVED] Moving vm Backup to an other Datastore

sruehl

New Member
Feb 1, 2022
4
0
1
53
Hi everybody,

I made a mistake when I was calculating needed diskspace of a Datastore…
I included too many Vms in a backup schedule storing them in one specific datastore.
Since increasing diskspace for the datastore is not an option any more (already at 80TB size) I would like to move the backups of some larger machines to an other datastore while keeping the backup history of these machines.

Fully moving a datastore is as far as I know, not much of a problem:
- Create new datastore
- rsync data under mnt/datastore/OLDDATASTORE to mnt/datastore/NEWDATASTORE
- Mount newdatastore in PVE
- change Backup Job to store the Backups in NEWDATASTORE
Since Backup recognises the VM ID it continues the backups under the new datastore making them accessible for full- and filelevel restore. (Haven’t tested it jet but read about it in some articles on the net)

But what if I just want to move all the backups of a specific VM to a new Datastore? How can I decide, which Chunks (under .chunks) belong to a certain maschine?

Or is this a completely wrong approach?

Thanks for your help,


Stefan
 
Hi Dylan,
works perfect! Thanks a lot!

Short summery to others:
Choosing a specific VM to move to the VM to an other Datastore is currently (PBS 2.1-2) not available in the GUI. You have to change an existing SYNC Job using the shell:
# proxmox-backup-manager sync-job update ID --group-filter group:vm/100
where ID is the sync job ID you get when listing sync jobs using
# proxmox-backup-manager sync-job list

Best regards,
Stefan
 
Great to hear it, and thanks for adding the guide! I should have thought to mention the 'group-filters' [1] in my answer, but good that you found it :)
Note that you can also create a new sync job with the group filter enabled, rather than altering an existing one:
Code:
proxmox-backup-manager sync-job create <ID> --group-filter group:vm/100 --remote <remote> --remote-store <from-datastore> --store <to-datastore>
where '<remote>' refers to the remote you configured with 'localhost'.

Would you also mind marking the thread as "Solved" so that others with the same issue can find a solution easier?

[1] https://pbs.proxmox.com/docs/managing-remotes.html#sync-jobs
 
Fully moving a datastore is as far as I know, not much of a problem:

I recently tried exactly that, but it didn't work as expected

- Create new datastore
- rsync data under mnt/datastore/OLDDATASTORE to mnt/datastore/NEWDATASTORE
- Mount newdatastore in PVE

This is where i got an error message telling me, that it couldn't create a subdirectory (yeah, because they were all there!).

Or is this a completely wrong approach?

Kind of. At least i had no luck trying this:

Bash:
mkdir /mnt/stor01-pbs
mount -t nfs nas01:/pbs /mnt/stor01-pbs

Then i added this directory as a Datastore in the GUI, it created the subdirectories and everything was OK. Until i realized the difference in the mountpoint and the actual hostname of my NFS storage. No big deal, i thought and i removed the datastore in the GUI.

After that i corrected the directory name:

Bash:
umount /mnt/stor01-pbs
mv /mnt/stor01-pbs /mnt/nas01-pbs
mount -t nas01:/pbs /mnt/nas01-pbs

And when i re-added the new directory as a datastore i got the error message. I can't remember the exact wording but it told me, that it couldn't create a subdirectory and it didn't add the datastore.

How are we supposed to recover from such a situation? Can i somehow add an existing directory structure to a newly created PBS?

Thanks
Markus
 
And when i re-added the new directory as a datastore i got the error message. I can't remember the exact wording but it told me, that it couldn't create a subdirectory and it didn't add the datastore.

How are we supposed to recover from such a situation? Can i somehow add an existing directory structure to a newly created PBS?
I guess the problem is that the old datastore files are still in the nfs directory: nas01:/pbs.
Was there any backup data on this datastore? If not, you could delete all the files from the directory (note the hidden .lock file and .chunks directory), the create a new datastore at the path.

Note that a simpler solution than copying with rsync is proposed and accepted in this thread.
 
I guess the problem is that the old datastore files are still in the nfs directory: nas01:/pbs.
Was there any backup data on this datastore? If not, you could delete all the files from the directory (note the hidden .lock file and .chunks directory), the create a new datastore at the path.

Note that a simpler solution than copying with rsync is proposed and accepted in this thread.

Yes, thanks. I saw that but what if there is a total desaster in a DC? All that's left is a USB drive with the contents of last week's PBS Datastore and i need to start completely with new hardware for the whole DC.

I cannot import the contents of this offline backup to a new PBS?

Thanks
Markus
 
I have the same problem as ctsde_markus
reinstalled pbs it is on sdb and the datastore was on sda there are archival copies of vm
how to connect old datastore?

1649856877541.png

1649856980957.png


1649856945204.png
 
The original question detailed moving the contents of an active datastore safely. If I understand correctly, the topic of discussion is now reattaching an old datastore to a new PBS instance.

For this, you could just mount the drive with the datastore to the new (or freshly reinstalled) system, and manually add an entry in the file /etc/proxmox-backup/datastore.cfg for it, with the following contents:
Code:
datastore: <DATASTORE-NAME>
    path /path/to/datastore
where '/path/to/datastore' is the location of the datastore on the mounted drive.
 
  • Like
Reactions: Kosh
The original question detailed moving the contents of an active datastore safely. If I understand correctly, the topic of discussion is now reattaching an old datastore to a new PBS instance.

For this, you could just mount the drive with the datastore to the new (or freshly reinstalled) system, and manually add an entry in the file /etc/proxmox-backup/datastore.cfg for it, with the following contents:
Code:
datastore: <DATASTORE-NAME>
    path /path/to/datastore
where '/path/to/datastore' is the location of the datastore on the mounted drive.
Thanks!

That's what i was searching for. It's a bit weird to get an error message when adding an already "used" directory structure rather than the GUI checking and acting accordingly.

Can someone take this as a "nice to have" feature request?

Thanks a lot!
Markus
 
  • Like
Reactions: dylanw
The original question detailed moving the contents of an active datastore safely. If I understand correctly, the topic of discussion is now reattaching an old datastore to a new PBS instance.

For this, you could just mount the drive with the datastore to the new (or freshly reinstalled) system, and manually add an entry in the file /etc/proxmox-backup/datastore.cfg for it, with the following contents:
Code:
datastore: <DATASTORE-NAME>
    path /path/to/datastore
where '/path/to/datastore' is the location of the datastore on the mounted drive.
thanks i did it
 
  • Like
Reactions: dylanw

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!