Change ownership of backups

egrueda

Renowned Member
Nov 9, 2010
47
0
71
Madrid, Spain
Hi! I have 2 different users in the same PBS server.
Now "user2" is no more, so I want "user1" to have access to all backups created by "user2"
How can I "move" all backups from user2 to user1?
Thanks
 
there is currently no way to mass reassign backup owners, but you'd have to do it one by one for each backup group, or you use the cli/api to script it
(e.g. with 'proxmox-backup-client change-owner' )
 
Thanks for you help, Dominik, I'll try to script it.
I see command "proxmox-backup-client list" exports user when json output is selected, so I'll use that to filter by owner.
Bet regards
 
Hy everybody,

there is an bit "dangerous" way to do this over the console/ssh

Estimation:
VM with ID: 100, 101, 102
BackupSpace: myBackup
OldUser: proxBack1@pam
NewUser: proxBack2@pbs

The Backups for those VMs are stored in the following directory:

/mnt/datastorage/myBackup/vm/100
/mnt/datastorage/myBackup/vm/101
/mnt/datastorage/myBackup/vm/102

ct are in
/mnt/datastorage/myBackup/ct/{id}

server
/mnt/datastorage/myBackup/server

additional namespaces and there ct/vm/servers
/mnt/datastorage/myBackup/ns

Case 1: Change User only for VM100
01. cd /mnt/datastorage/myBackup/vm/100
02. sed -i.bak 's/proxBack1@pam/proxBack2@pbs/g' owner

Case 2: Change User in all VM's
01. cd /mnt/datastorage/myBackup/vm
02. find . -name "owner" -exec sed -i.bak 's/proxBack1@pam/proxBack2@pbs/g' {} \;

Case 3: Change User in all Backups
01. cd /mnt/datastorage/myBackup
02. find . -name "owner" -exec sed -i.bak 's/proxBack1@pam/proxBack2@pbs/g' {} \;

The owner of a Backup of a VM/CT/Server is written plain in the "owner" file in
each VM/CT/Server-Backup-Directory

sed -i.bak 's/proxBack1@pam/proxBack2@pbs/g' owner .. replaces the string "proxBack1@pam" with "proxBack2@pbs",
the parameter -i.bak .. automatically creates a backup of the "owner"-File called: owner.bak (for security reason!)

best regards

PP
 
Last edited:
  • Like
Reactions: _gabriel and pizza

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!