Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9994

PowerShell • Re: Migrate backup from one job to an other

$
0
0
I make this, it seems to work but maybe you have a better idea ?

It's only for vmware backup and I get only the latest restore point of the VM to know which job is the source job
I removed the -AsSync for the move-vbrbackup because it causes issue when VM I need to move are on the same source job... It's sad to implement this parameter on the cmdlet and not done the job on the Veeam side to be able to manage different VM from the same source job. Maybe an improvment to do for next version.
It take lot's of more time to do it sequentially ...

Code:

$VMs = "vm1","vm2"$AllBackupJob = Get-VBRBackup | Where-Object {$_.TypeToString -eq "VMware Backup"}$TargetJob = "bkpjob-destination"Foreach ($VM in $VMs){    $Query = Get-VBRRestorePoint -Backup $AllBackupJob -Name $VM    #If VM is in current backup job    if ($query) {        #Get last restore point created        $LastJob = $Query | Sort-Object CreationTime -Descending | Select-Object -First 1    }    #Get backup job name used for the last restore point    $SourceJob = $LastJob.GetSourceJob().Name    $SourceJobObj = Get-VBRBackup -Name $SourceJob    $TargetJobObj = Get-VBRJob -Name $TargetJob    #Move backup from source backup job to target backup job    Move-VBRBackup -Backup $SourceJobObj -Job $TargetJobObj -Name $VM}

Statistics: Posted by matteu — Jun 10, 2025 8:50 pm



Viewing all articles
Browse latest Browse all 9994

Latest Images

Trending Articles



Latest Images