Sync not copying all snapshots

ca_maer

Well-Known Member
Dec 5, 2017
181
14
58
44
Hello,

I had a VM with the ID 135 that was re-deployed under the ID 105. To keep the backups from the old machine, I did the following on my datastore:

Code:
mv vm/135 vm/105

I then switched the backup job in Proxmox VE to backup the new VM 105.
This seems to work as all my previous backup from my old VM show up under the new VM now.

Screen Shot 2021-06-02 at 11.30.14 AM.png

The issue that I have is my job that replicates all the backups to another PBS for some reason ignores the old backups that were moved

Screen Shot 2021-06-02 at 11.33.14 AM.png

If I run the sync job manually, it return that everything is in sync.
Code:
2021-06-02T11:24:57-04:00: re-sync snapshot "vm/105/2021-06-02T04:04:36Z" done
2021-06-02T11:24:57-04:00: percentage done: 41.18% (6 of 17 groups, 17 of 17 group snapshots)
2021-06-02T11:24:57-04:00: re-sync snapshot "vm/107/2021-06-02T04:00:02Z"
2021-06-02T11:24:57-04:00: no data changes

Any idea why this is the case ?

Maybe it's not recommended to rename and move old backups under a new backup group ? if so how should I proceed if I redeployed the same server under a different ID and want to keep the old backups ?

Thanks
 
Maybe file permission are wrong? What unix user owns the old snapshots?
Permissions are the same on both servers

Server 1:
Code:
root@prd-pbs-1n1:/mnt/prd-nas-1/Backups/PBS/vm/105# ls -la
total 333
drwxrwx--- 19 root backup 20 Jun  2 06:00 .
drwxrwx--- 15 root backup 15 May 27 09:46 ..
drwxrwx---  2 root backup  6 Jun  2 11:24 2021-05-02T04:55:38Z
drwxrwx---  2 root backup  6 May  9 17:35 2021-05-09T04:49:14Z
drwxrwx---  2 root backup  6 May 16 18:43 2021-05-16T04:28:34Z
drwxrwx---  2 root backup  6 May 23 18:49 2021-05-20T04:41:24Z
drwxrwx---  2 root backup  6 May 23 18:49 2021-05-21T04:36:28Z
drwxrwx---  2 root backup  6 May 23 18:49 2021-05-22T04:35:28Z
drwxrwx---  2 root backup  6 May 23 18:48 2021-05-23T04:29:18Z
drwxrwx---  2 root backup  6 May 30 19:11 2021-05-24T04:30:29Z
drwxrwx---  2 root backup  6 May 30 19:10 2021-05-25T04:38:16Z
drwxrwx---  2 root backup  6 May 30 19:09 2021-05-26T05:34:53Z
drwxrwx---  2 root backup  6 May 30 18:58 2021-05-27T04:03:27Z
drwxrwx---  2 root backup  6 May 30 18:57 2021-05-28T04:02:47Z
drwxrwx---  2 root backup  6 May 30 18:56 2021-05-29T04:02:52Z
drwxrwx---  2 root backup  6 May 30 18:54 2021-05-30T04:01:40Z
drwxrwx---  2 root backup  6 May 31 00:05 2021-05-31T04:01:37Z
drwxrwx---  2 root backup  6 Jun  1 00:07 2021-06-01T04:03:25Z
drwxrwx---  2 root backup  6 Jun  2 00:08 2021-06-02T04:04:36Z
-rwxrwx---  1 root backup  9 May 27 00:03 owner
root@prd-pbs-1n1:/mnt/prd-nas-1/Backups/PBS/vm/105# cat owner
root@pam

Server 2 (Remote):
Code:
root@dev-pbs-1n1:/mnt/dev-nas-1/Backups/PBS/vm/105# ls -la
total 149
drwxrwx---  9 root backup 10 Jun  2 03:51 .
drwxrwx--- 15 root backup 15 May 28 04:34 ..
drwxrwx---  2 root backup  6 May 30 12:25 2021-05-27T04:03:27Z
drwxrwx---  2 root backup  6 May 30 12:25 2021-05-28T04:02:47Z
drwxrwx---  2 root backup  6 May 30 12:24 2021-05-29T04:02:52Z
drwxrwx---  2 root backup  6 May 31 03:02 2021-05-30T04:01:40Z
drwxrwx---  2 root backup  6 Jun  1 04:25 2021-05-31T04:01:37Z
drwxrwx---  2 root backup  6 Jun  2 03:51 2021-06-01T04:03:25Z
drwxrwx---  2 root backup  6 Jun  2 11:25 2021-06-02T04:04:36Z
-rwxrwx---  1 root backup  9 May 27 03:47 owner
root@dev-pbs-1n1:/mnt/dev-nas-1/Backups/PBS/vm/105# cat owner
root@pam
 
can you post the complete sync task log please ?
 
ok, i found it. we only sync snapshots that are newer than the last sync
you can workaround this by deleting the sync job and recreate it, then it will sync everything again (or create a new sync job)

we'll improve the logging so that this will be apparent and think about how we can improve that, since there are some use-cases where
not syncing older snapshots is bad
 
  • Like
Reactions: hvisage
ok, i found it. we only sync snapshots that are newer than the last sync
you can workaround this by deleting the sync job and recreate it, then it will sync everything again (or create a new sync job)

we'll improve the logging so that this will be apparent and think about how we can improve that, since there are some use-cases where
not syncing older snapshots is bad
Make sense. I think for the time being I will manually sync it to the remote server by hand with rsync since deleting and creating the sync job again would sync all my backups (couple of TB) which is not ideal.

Should I open a request in bugzila for this ?

Thanks for the help
 
actually, i was wrong, a recreation of the sync job would not have triggered the sync anyway (i misread the source). only snapshots that are newer than the newest snapshot on
the target will be synced....

Should I open a request in bugzila for this ?
you can, but since this is not a common use-case, i cannot promise that we will implement any workaround...

I think for the time being I will manually sync it to the remote server by hand with rsync
make sure you also sync the .chunks folder (the snapshots only contain metadata and references to the chunks)
 
Gotcha. Regarding my case where I want to keep the backups from an oldest VM under a different ID, is there a better way to do it or moving then rsync the snapshots and chunk folder is the best way since the sync is ignoring the oldest snapshots ?
 
is there a better way to do it or moving then rsync the snapshots and chunk folder is the best way since the sync is ignoring the oldest snapshots ?

if the old vm id was also synced, you can also move the snapshots on the target pbs instead of rsyncing
 
if the old vm id was also synced, you can also move the snapshots on the target pbs instead of rsyncing
Not sure I follow you there. Moving and rsync the snapshot folder and chunk folder is the same thing no ?
If my VM with ID 105 becomes the ID 135 and I want to keep the old backups and migrate them under the ID 135 and then sync them to a remote PBS, what is the best way to proceed ?

From my understanding it's
  1. mv vm/105 vm/135
  2. rsync the snapshosts to the remote PBS
  3. rsync the chunk folder to the remote PBS
Now everything should be in sync ? Is there an easier or best way ?
 
i meant the vm/105 snapshots are probably on the remote pbs, so you can make the 'mv vm/105 vm/135' there too ?
but yes, aside from that difference, there is currently no easier way
 
  • Like
Reactions: ca_maer

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!