For the benefit of any future searchers, this was added when PBS3.3 was released
https://pbs.proxmox.com/wiki/index.php/Import_VMA_Backups_into_Proxmox_Backup_Server
The wiki page doesn't show it but the current version of vma-to-pbs can in fact import an entire directory without piping individual vma.zst files or whatever, which I wish I had realised before I went to the trouble of writing a wrapper bash script to extract VM IDs and timestamps etc from the filename, but never mind, eh
NB
* You have to pull the historical dumps in before you do any newer backups in that namespace (if you want everything, old and new, to be in the same namespace, anyway).
* You will need to make a file containing your PBS API token secret (or the password for the PBS user account, if you're not using a token) - in my example, this is stored in /root/backup-token-secret.txt
* You will need to make a file containing your backup encryption key (you are using encryption, right?) - if you're not using encryption you should remove --encrypt and --keyfile from the vma-to-pbs call. In my example this is stored in /root/backup-encryption-key.txt
* "repository" is in the format "user@realm!tokenid@IPorHOSTNAME

ataStore
* if you're not using a namespace, remove the --ns argument
Here is an example execution, importing to a PBS as a token 'mytoken' issued under the user 'myuser' on a PBS on 192.168.1.20 to datastore called "NVME" to a namespace "my-namespace" from /mnt/pve/cephfs/dump
Bash:
vma-to-pbs --fingerprint '1a:2b:3c:4d:5e:6f:7a:8b:9c:0d:1e:2f:3a:4b:5c:6d:7e:8f:9a:0b:1c:2d:3e:4f:5a:6b:7c:8d:9e:0f:1a:2b' \
--repository 'myuser@pbs!mytoken@192.168.1.20:NVME" --ns my-namespace \
--password-file /root/backup-token-secret.txt --compress --encrypt \
--keyfile /root/backup-encryption-key.txt /mnt/pve/cephfs/dump
And the output would look something like;
Code:
Key Password:
Found 1 backup archive(s) of 1 different VMID(s):
- VMID 100: 1 backups
Proceed with the bulk import? (Y/n):
PBS repository: myuser@pbs!mytoken@192.168.1.20:NVME
PBS namespace: my-namespace
PBS fingerprint: 1a:2b:3c:4d:5e:6f:7a:8b:9c:0d:1e:2f:3a:4b:5c:6d:7e:8f:9a:0b:1c:2d:3e:4f:5a:6b:7c:8d:9e:0f:1a:2b
compress: true
encrypt: true
Uploading VMA backup from "/mnt/pve/cephfs/dump/vzdump-qemu-100-2025_04_11-14_21_26.vma.zst"
backup time: 2025-04-11T15:21:26+01:00
CFG: size: 600 name: qemu-server.conf
DEV: dev_id=1 size: 34359738368 devname: drive-scsi0
Uploading dev_id: 1 (0%)
Uploading dev_id: 1 (12%)
Uploading dev_id: 1 (24%)
Uploading dev_id: 1 (36%)
Uploading dev_id: 1 (48%)
Uploading dev_id: 1 (61%)
Uploading dev_id: 1 (73%)
Uploading dev_id: 1 (85%)
Uploading dev_id: 1 (97%)
Backup finished within 0 minutes, 13 seconds and 633 ms