PowerShell script exchange
Post Reply
hmurat
Influencer
Posts: 11
Liked: never
Joined: Nov 15, 2018 9:48 pm
Contact:

9.5 Update4 - Attempting restore, no session exists

Post by hmurat »

Hello!

We've recently updated 9.5 Update4 and I'm seeing the "your old cmdlets are old, use the new ones" message, so I'm attempting it and failing.

The examples from Get-Help Restore-VESQLDatabase show the following:

Code: Select all

$session = Get-VESQLRestoreSession
$database = Get-VESQLDatabase -Session $session[0] -Name "MyDatabaseName"
Restore-VESQLDatabase -Database $database -Server "ServerNameGoesHere"
The problem I'm experiencing is that the $session variable comes out null. There are no restore sessions taking place and I cannot figure out how to create one. Does anyone have any suggestions?

Also, I've noticed that the documentation here https://helpcenter.veeam.com/docs/backu ... tml?ver=95 isn't yet up to date - is there an ETA for this?

Thanks in advance!

Hugh
hmurat
Influencer
Posts: 11
Liked: never
Joined: Nov 15, 2018 9:48 pm
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by hmurat »

The error I receive:

Code: Select all

Cannot index into a null array.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by veremin »

Have you started VESQL restore session first, using Start-VESQLRestoreSession cmdlet? Thanks!
hmurat
Influencer
Posts: 11
Liked: never
Joined: Nov 15, 2018 9:48 pm
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by hmurat »

Nope, I sure didn't! I ran Get-Command -Module VeeamPsSnapin to get all the cmdlets available in that module and didn't see Start-VESQLRestoreSession in the list of available commands. Is this still the correct powershell module or should I be using something different?
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by veremin »

It might be implemented as a part of different VESQL module (if my memory serves me well). Anyway, can you try to executed restore session, using the mentioned cmdlet, and see what happens? Thanks!
hmurat
Influencer
Posts: 11
Liked: never
Joined: Nov 15, 2018 9:48 pm
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by hmurat »

I did some poking around and found the VESQL commands you're referring to inside the Veeam.SQL.PowerShell module. I'll give it a shot today and post back what I've been able to accomplish! Thank you!
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by veremin »

Great, this means I remembered everything correctly: for each explorer (besides one for Active Directory) there is a dedicated PowerShell module - VESQL, VESP and VEX. Thanks!
hmurat
Influencer
Posts: 11
Liked: never
Joined: Nov 15, 2018 9:48 pm
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by hmurat »

I haven't and a ton of time, but I've been tinkering a little bit. I need to figure out which ApplicationRestorePoint to use when instantiating the RestoreSession.
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by jhoughes »

The restore session must be initialized with the created with Start-VESQLRestoreSession first, that is why your $session variable is empty when you first run the code.

You can also find the updated docs for Get-VBRApplicationRestorePoint here.

You can either use the "SQL" parameter to find all SQL restore points and select which object within the array to use.

Otherwise,m you may want to first determine which point you want based on time of the backup, then use the ID of that object with "Get-VBRApplicationRestorePoint -ID" to return that single application restore point.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
hmurat
Influencer
Posts: 11
Liked: never
Joined: Nov 15, 2018 9:48 pm
Contact:

Re: 9.5 Update4 - Attempting restore, no session exists

Post by hmurat »

Thanks for the response - as soon as I've got the time to spend on this, I'll post back with my experiences and probably an example of the script I'm using.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests