Choose which Veeam server to restore from?

Availability for the Always-On Enterprise

Choose which Veeam server to restore from?

Veeam Logoby sbrissen » Thu Apr 27, 2017 12:36 pm

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?
sbrissen
Novice
 
Posts: 5
Liked: never
Joined: Thu Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden

Re: Choose which Veeam server to restore from?

Veeam Logoby foggy » Thu Apr 27, 2017 12:45 pm

Hi Scott, are you talking about restore from the local repository of from the backup copy?
foggy
Veeam Software
 
Posts: 15289
Liked: 1133 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson

Re: Choose which Veeam server to restore from?

Veeam Logoby sbrissen » Thu Apr 27, 2017 1:13 pm

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
sbrissen
Novice
 
Posts: 5
Liked: never
Joined: Thu Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden

Re: Choose which Veeam server to restore from?

Veeam Logoby v.Eremin » Thu Apr 27, 2017 2:00 pm

What name do you specify as $vbrJobName? Name of your local backup job or name of backup copy job?
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Choose which Veeam server to restore from?

Veeam Logoby sbrissen » Thu Apr 27, 2017 3:09 pm

$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.
sbrissen
Novice
 
Posts: 5
Liked: never
Joined: Thu Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden

Re: Choose which Veeam server to restore from?

Veeam Logoby v.Eremin » Thu Apr 27, 2017 3:52 pm 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.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Choose which Veeam server to restore from?

Veeam Logoby sbrissen » Thu Apr 27, 2017 7:28 pm

That seems to have done the trick, thanks!
sbrissen
Novice
 
Posts: 5
Liked: never
Joined: Thu Apr 27, 2017 12:20 pm
Full Name: Scott Brissenden

Re: Choose which Veeam server to restore from?

Veeam Logoby v.Eremin » Fri Apr 28, 2017 11:16 am

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!
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to Veeam Backup & Replication



Who is online

Users browsing this forum: Bing [Bot], CharlesMak, Google [Bot], Google Feedfetcher and 1 guest