-
- Novice
- Posts: 5
- Liked: never
- Joined: Apr 27, 2017 12:20 pm
- Full Name: Scott Brissenden
- Contact:
Choose which Veeam server to restore from?
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?
-
- Veeam Software
- Posts: 21139
- Liked: 2141 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: Choose which Veeam server to restore from?
Hi Scott, are you talking about restore from the local repository of from the backup copy?
-
- 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?
I would like to use the local repository and not the backup copy.
In my script I call the restore with the following code:
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
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Choose which Veeam server to restore from?
What name do you specify as $vbrJobName? Name of your local backup job or name of backup copy job?
-
- 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?
$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.
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.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Choose which Veeam server to restore from?
Try to assign $RestorePoint a bit differently and see whether it makes a difference:
Thanks.
Code: Select all
Get-VBRRestorePoint -name "Name of VM" | where {$_.GetSourceJob().name -eq "Name of backup Job"} | Sort-Object {[DateTime]$_."CreationTime"} | select -Last 1
-
- 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?
That seems to have done the trick, thanks!
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Choose which Veeam server to restore from?
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!
Who is online
Users browsing this forum: Baidu [Spider] and 82 guests