Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
bhyujn
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 19, 2019 9:11 am
Contact:

Restore 1 file from "file to tape backup" job using powershell

Post by bhyujn »

Hey,

Is it possible to restore singe file from "file to tape backup" with powershell?
I couldn't find this kind of script.

I could be Veeam design that restore is only possible with GUI
Mildur
Product Manager
Posts: 8735
Liked: 2294 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by Mildur »

Hi bhyujn

Have you tried it with Start-VBRTapeFileRestore?
https://helpcenter.veeam.com/docs/backu ... ml?ver=120

Best,
Fabian
Product Management Analyst @ Veeam Software
bhyujn
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 19, 2019 9:11 am
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by bhyujn »

Hey,

I saw this command, but i don't understand how i can find single file from backup?
Do you have example script?
Mildur
Product Manager
Posts: 8735
Liked: 2294 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by Mildur »

Hello bhyujn

I will try to get something together. A short test in my lab showed me that it is a complicated approach (using Find-VBRTapeCatalogItem multiple times to dive into the path). My plan is to reach out to the PowerShell team and get some guidance if there is a better option.

Best,
Fabian
Product Management Analyst @ Veeam Software
bhyujn
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 19, 2019 9:11 am
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by bhyujn »

Hey,

Could you share your script?
I will try to change it so it fits into my enviroment.
Mildur
Product Manager
Posts: 8735
Liked: 2294 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by Mildur »

Hi bhyujn

I discussed the topic with the team. First let me say, tape restore cmdlets are deprecated and should not used anymore. They still may work. There is a note about that on the root page for all tape cmdlets: https://helpcenter.veeam.com/docs/backu ... ml?ver=120
IMPORTANT!
Veeam PowerShell terminates support for restoring from tape archives. The tape restore cmdlets are obsolete. They will work, but it is recommended to perform the tape restore operation with Veeam Backup & Replication UI for full functionality.
The following code should work to get the file restored:

Code: Select all

$srchost = Get-VBRServer -Name <server name as shown in the UI>
$targethost = Get-VBRServer -Name <Targethost (must be added to Veeam as a managed server)>
$item = Find-VBRTapeCatalogItem -Server $srchost -Name "filename"
Start-VBRTapeFileRestore -Server $targethost -Path "C:\Backup restore\Fileserv05" -CatalogItem $item
May I ask, why you want to use Powershell for such restores? Are you looking for a way to do automated recovery testing for tapes?

Best,
Fabian
Product Management Analyst @ Veeam Software
bhyujn
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 19, 2019 9:11 am
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by bhyujn »

Hey,

then it's possible to trigger file restore from IIS Application and users don't need anykind of access to veeam server.
Users know filename what they want to restore and they dont need to learn how to restore files from veeam.
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by david.domask »

Hi @bhyujn,

As Fabian (Mildur) mentioned, these cmdlets are Obsolete and no longer supported. It is probable that they will be removed in the future and if there are any issues with the cmdlets, there will be no support. I do not advise trying to build any solutions around obsolete items, as there is a non-zero chance that these cmdlets will no longer work.

Unfortunately there is not a supported alternative right now; we will note this as a feature request for automated file restores

https://helpcenter.veeam.com/docs/backu ... ml?ver=120 (please see the note)
https://helpcenter.veeam.com/docs/backu ... ml?ver=120 (note that the cmdlets to start the restore are obsolete)
David Domask | Product Management: Principal Analyst
bhyujn
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 19, 2019 9:11 am
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by bhyujn »

hey,

I understand, that these powershell command are fazeout.
I hope that soon there will new supported way to restore file from tape using powershell.
I'm sure that i'm not only one who want to restore files with powershell.
bhyujn
Influencer
Posts: 10
Liked: 2 times
Joined: Nov 19, 2019 9:11 am
Contact:

Re: Restore 1 file from "file to tape backup" job using powershell

Post by bhyujn » 1 person likes this post

Hey,

Currently working solution.

Code: Select all

$Sourceserver = Get-VBRServer -Name server1
$Targetserver = Get-VBRServer -Name server1

#File locates f:\backup\test.txt

# F: Drive
$item = Find-VBRTapeCatalogItem -Server $Sourceserver -Name "F:"
# Backup directory
$item1=Find-VBRTapeCatalogItem  -CatalogItem $item
# test.txt file
$item2=Find-VBRTapeCatalogItem  -CatalogItem $item1 | where Name -eq $Filename
# Restore
Start-VBRTapeFileRestore -Server $Targetserver -Path c:\temp\ -CatalogItem $item2
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests