Syncronize/Move Backups on the same server into another namespace

May 6, 2021
68
13
13
Bern, Switzerland
Hello Guys
I would like to "move" several existing backups on the same pbs from the root namespace into an upward newly created one.
This has to be done, because we have to use a different retention for this backups.
I tried to do this trough a sync job but ran into errors.

Is there a different/supported method for doing such stuff?

Regards, Urs
 
Hey,

easiest is probably a sync job with a depth of one. Then after the sync delete them in the root NS.
 
Hey,

easiest is probably a sync job with a depth of one. Then after the sync delete them in the root NS.
Thank you. What I did:
  1. Created a namespace "Target"
  2. Tried to create a Pull Sync-Job with:
    1. Set Job Location Local
    2. Pull from local datastore to "Target"
    3. but I'm unable to choose a source datastore, there is no root or other namespace available.
1744216963643.png
The other way, to push it would mean I would need to create a destination that is the pbs itself?

Regards, Urs
 
Thank you. What I did:
  1. Created a namespace "Target"
  2. Tried to create a Pull Sync-Job with:
    1. Set Job Location Local
    2. Pull from local datastore to "Target"
    3. but I'm unable to choose a source datastore, there is no root or other namespace available.
View attachment 84724
The other way, to push it would mean I would need to create a destination that is the pbs itself?

Regards, Urs
Sorry, @Hannes Laimer to nag you, should I open an Incident as this does not work for me or I am just not able to understand the concept?

Kind regards, Urs
 
Hi, if that suits you, you can also move backups to a different namespace on the command line, see this post. For me, that's the easiest way. Changes show up instantly in the PBS GUI (after you reload the page).
 
Sorry, I missed your reply here. I am not sure why, but in my head we allowed sync jobs to the same local datastore, I just checked our code, and as you also noticed, we don't.

So, you first create the namespace you want(if you havent already), then cd into your datastore. And move the vm, ct and host folders into the namespace with
Code:
mv vm ns/<NAMESPACE>/
mv ct ns/<NAMESPACE>/
mv host ns/<NAMESPACE>/

note: not all of these three folders must exist, depending on what types of backups you have.
 
Thank you guys (@Hannes Laimer and @alietz ) for your reply

Do I understand correctly:
  • I will go into the shell of the *pbs* itself
  • I may move a single or multiple backups from vm to ns?
Eg.
Code:
cd /zpool/where/we/store/our/backups
mv vm/100/ ns/NewHotAndCoolNameSpace/

Kind regards, Urs
(who doesn't like to just fiddle around on the productive pbs)
P.S.: that brings me into, we're having a test machine that I might use :rolleyes:)
 
Another option might be to set up a "remote sync" with localhost or the hostname of your PBS. Still a workaround but less error-prone than shell commands imho
 
Thank you guys (@Hannes Laimer and @alietz ) for your reply

Do I understand correctly:
  • I will go into the shell of the *pbs* itself
  • I may move a single or multiple backups from vm to ns?
Eg.
Code:
cd /zpool/where/we/store/our/backups
mv vm/100/ ns/NewHotAndCoolNameSpace/

Kind regards, Urs
(who doesn't like to just fiddle around on the productive pbs)
P.S.: that brings me into, we're having a test machine that I might use :rolleyes:)
Ok, tried it on the test pbs.

1st attempt:
  • mv vm/108 /ns/MoveTest
  • logged into the test pbs
  • vm/108 is no more visible under root
  • ns/MoveTest is empty
  • reload didn't work either
2nd attemp:
  • created directory vm under ns/MoveTest
  • moved ns/MoveTest/108 to ns/MoveTest/vm
  • logged in into test pbs
  • vm 108 is visible under the ns/MoveTest
  • logged in into test pve
  • created the appropriate Storage
  • went to vm/108 and selected the new backup storage
  • vm/108's backup was visible and I could have a look into files/partitions
  • so it works
conclusion:
  • Create new namespace
  • create directory vm under the new namespace
  • move backups from ..(root)/vm/nnnn to newnamespace/vm
Will give it a try on production after easter weekend.
 
For the sake of completeness:
mv vm/108 /ns/MoveTest moved 108 into /ns/MoveTest, but it has to be in vm/. So either
- mv vm/108 /ns/MoveTest/vm/
- or, the whole vm dir with mv vm /ns/MoveTest/
 
  • Like
Reactions: Jackobli