Comprehensive data protection for all workloads
Post Reply
sbrissen
Novice
Posts: 5
Liked: never
Joined: Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden
Contact:

Choose which Veeam server to restore from?

Post by sbrissen »

I have a script that automates the restore of a SQL DB from the most recent copy of a production database to a development server. We have 2 Veeam servers, one in our main datacenter (named vbr) and one in our Colo (named colovbr). VBR backs up the SQL server, then a backup copy job runs that copies it to COLOVBR. The problem I have is that when I kick off the restore of the SQL DB it is using COLOVBR to do the restore and takes hours to finish since it is going over the WAN, I would like it to use VBR. Is there a way to select which Veeam server to use to do the backup?
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Choose which Veeam server to restore from?

Post by foggy »

Hi Scott, are you talking about restore from the local repository of from the backup copy?
sbrissen
Novice
Posts: 5
Liked: never
Joined: Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden
Contact:

Re: Choose which Veeam server to restore from?

Post by sbrissen »

I would like to use the local repository and not the backup copy.

In my script I call the restore with the following code:

Code: Select all

$restorePoint = Get-VBRApplicationRestorePoint -SQL -Name $vbrJobName | Sort-Object {[DateTime]$_."CreationTime"} | select -Last 1
$dbRestorePoint = Get-VBRSQLDatabase -ApplicationRestorePoint $restorePoint -Name $vbrJobDB
Start-VBRSQLDatabaseRestore -Database $dbRestorePoint -ServerName $vbrJobDestination -InstanceName $vbrJobInstance -DatabaseName $vbrJobDBRestoreName -GuestCredentials $guestcreds -SqlCredentials $guestcreds -Force
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Choose which Veeam server to restore from?

Post by veremin »

What name do you specify as $vbrJobName? Name of your local backup job or name of backup copy job?
sbrissen
Novice
Posts: 5
Liked: never
Joined: Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden
Contact:

Re: Choose which Veeam server to restore from?

Post by sbrissen »

$vbrJobName is actually the VM Name. If I try to search using the Backup job name, the command tells me there is no job with that name.

https://helpcenter.veeam.com/docs/backu ... tml?ver=95
The description of the -Name flag is actually misleading "Filters the restore points by name of the backup job." But in Example 2 at the bottom of the page is says to use the VM name.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Choose which Veeam server to restore from?

Post by veremin » 1 person likes this post

Try to assign $RestorePoint a bit differently and see whether it makes a difference:

Code: Select all

Get-VBRRestorePoint -name "Name of VM" | where {$_.GetSourceJob().name -eq "Name of backup Job"} | Sort-Object {[DateTime]$_."CreationTime"} | select -Last 1
Thanks.
sbrissen
Novice
Posts: 5
Liked: never
Joined: Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden
Contact:

Re: Choose which Veeam server to restore from?

Post by sbrissen »

That seems to have done the trick, thanks!
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Choose which Veeam server to restore from?

Post by veremin »

I've made the code select only restore points that were created by source backup job, therefore the script now meets your expectations. Glad to hear that you're up and running now!
Post Reply

Who is online

Users browsing this forum: B.F., rweis and 266 guests