Here is my script:
Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn
$restorepoint = Get-VBRApplicationRestorePoint -SQL -Name "ProductionSQL"
$ProductionDatabase = Get-VBRSQLDatabase -ApplicationRestorePoint $restorepoint[-1] -Name "ProductionDatabase"
$guestcreds = Get-VBRCredentials -Name "DOMAIN\VeeamSvc"
$sqlcreds = Get-VBRCredentials -Name "DOMAIN\VeeamSvc"
Start-VBRSQLDatabaseRestore -Database $ProductionDatabase -ServerName TestSQLServer -DatabaseName ProductionDatabaseTest -GuestCredentials $guestcreds -SqlCredentials $sqlcreds -Wait
When I run this script I can see the job start on the Veeam B&R console but it fails with this error:
Code: Select all
"2/26/2016 11:35:32 AM Error Database restore failed: ExplorerManagementService: Failed to wait for OIB mounted. MountId: [644f5f51-7155-49cd-84eb-b02b572f9a62], Timeout: [00:00:05] (sessionId = 'ee88c510-6f59-43a4-9532-cd90b50fdee9')"
One thing I can think that might be causing this issue is lack file path in the script. When you restore something in Veeam, it will ask you the file path and file name (restoring to a different location) but with the powershell commands, I didn't see that option. Also, when you create a SQL script to restore a database to another location, you need to specify the database location/name in the script. The server that I am restoring to, doesn't have the same drive letters and file paths as the original server.
Thank you for any help!!!