I am trying to write a powershell script to automate the restoring of hyperv vm's from backup copy jobs that copy backups from our primary site to our secondary site.
my issue is when i issue a get-vbrrestorepoint against a backup copy job I do not get any results. If i issue the same command against a backup job all works as expected. I opened a support case #05502592 and they suggested using (get-vbrbackup -name "backup-copy-job-name").getallstorages(). this does not work either against backup copy jobs but does work with normal backup jobs.
My question is how do I get a list of restore points from by backup copy jobs so i can do restores from by secondary location where the backup copy job data resides?
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Jun 28, 2022 11:28 am
- Full Name: Michael Korthuis
- Contact:
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: use powershell to get backup copy job restore points
Hi Michael,
I reviewed your case and assume $backup.GetAllStorages() didn't work as you use backup copy job in immediate mode. It presents some architectural differences vs. periodic mode, so you need to get child backups first. Then, for logical units and further restore you can get a list of restore points:
For physical units you can then get a list of storages as in the screenshot in your support case:
Best regards,
Oleg
I reviewed your case and assume $backup.GetAllStorages() didn't work as you use backup copy job in immediate mode. It presents some architectural differences vs. periodic mode, so you need to get child backups first. Then, for logical units and further restore you can get a list of restore points:
Code: Select all
$backup = Get-VBRBackup -Name 'Backup Copy Job'
$childBackups = $backup.FindChildBackups()
Get-VRBRestorePoint -Backup $childBackups
Code: Select all
$backup = Get-VBRBackup -Name 'Backup Copy Job'
$childBackups = $backup.FindChildBackups()
foreach ($child in $childBackups) {
$child.GetAllStorages()
}
Oleg
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Jun 28, 2022 11:28 am
- Full Name: Michael Korthuis
- Contact:
Re: use powershell to get backup copy job restore points
worked as suggested. Thank you.
-
- Product Manager
- Posts: 14844
- Liked: 3086 times
- Joined: Sep 01, 2014 11:46 am
- Full Name: Hannes Kasparick
- Location: Austria
- Contact:
Re: use powershell to get backup copy job restore points
Hello,
update on this topic... with 12.1.1.56 it's easier. The FindChildBackups is not needed anymore
This is a simple example code:
Best regards,
Hannes
update on this topic... with 12.1.1.56 it's easier. The FindChildBackups is not needed anymore
This is a simple example code:
Code: Select all
$backup = Get-VBRBackup -Name "BCJ-nano-xfs"
$restorepoint = Get-VBRRestorePoint -Backup $backup | Sort-Object –Property CreationTime | Select -Last 1
$targetServerName = "scanserver"
$targetAdminCreds = Get-VBRCredentials -name "lab\dpapi"
Publish-VBRBackupContent -RestorePoint $restorepoint -TargetServerName $targetServerName -TargetServerCredentials $targetAdminCreds
Hannes
Who is online
Users browsing this forum: No registered users and 11 guests