How to move snapshot from group to another

Sep 17, 2024
44
9
8
Hi! I'm having a problem with intermixed vm id:s in a datastore. The situation is as follows. Last year there was a vm with id 104 backed up into datastore. But after that, it seems there were a couple of other backups of a different vm saved to the same namespace with the same vm id. I would like to move one backup away from the vm/104 group somewhere else, but I cannot figure out how. Any help is appreciated.

This is especially problematic situation when saving data to tape, as there is no easy way of distinguishing between different vm:s if those vms are within same namespace and have same id:s.
 

Attachments

  • Screenshot from 2025-04-26 23-00-08.png
    Screenshot from 2025-04-26 23-00-08.png
    26.9 KB · Views: 6
Is it ok to manually move the backup folder from under the vm/104/... into some other vm/xxx folder with mv inside the datastore structure?
 
I'm not sure if you've picked this up yet. PBS doesn't do regular backups. it's a huge database of file parts.
No, its not ok to move any part of the .chunks folder structure.

But "manually move" ... I don't know, maybe you had something other than that in mind. Describe your plan.
I was talking about the folders in the datastore ns/NamespaceName/vm/104 folder. If I have understood correctly, those files contain the lists of what chunks the backup (named like a timestamp) contains. I tried to move one of those folders from ns/NamespaceName/vm/104 to ns/NamespaceName/vm/108 and at least in the ui, the backup disappeared from the group 104 and appeared under the 108 group. I will run a verify next.
 
Please don't do that. I wouldn't risk breakage by doing something not documented and most likrly not dupported. The best course of Action would be to create a new namespace, create a sync job for sycing all vm104 backups to the new namespace. Afterwards remove the backups from each namespaces you fon't want to keep there.
Thanks to PBS deduplication this wouldn't cost addititional storage.
 
It would be nice if someone from the staff could confirm that is it safe to move the single backup folders from group folder to another as long as the source and destination is a vm type.
 
It would be nice if someone from the staff could confirm that is it safe to move the single backup folders from group folder to another as long as the source and destination is a vm type.
It is not in general, you might have concurrent operations going on. So just moving around files and folders will most likely work, until you run in an edge case and it does not. Further, PBS expects the snapshots in a backup group to have increasing backup times, so if you stuff in new snapshots, things like prune jobs or sync jobs might behave differently afterwards. E.g. sync jobs only ever sync newer snapshots that the last snapshot already present in the sync target.

In order to reorganize your datastore, the use of sync jobs is recommended, although there are some plans to improve e.g. https://bugzilla.proxmox.com/show_bug.cgi?id=6195

If you would like to manually perform changes on the datastore backing storage, I highly recommend to set the datastore into maintenance mode offline first. See https://pbs.proxmox.com/docs/maintenance.html#maintenance-mode

TLDR: It is recommended to use sync jobs for such operations.