PowerShell script exchange
Post Reply
rolltidega
Novice
Posts: 4
Liked: 2 times
Joined: Apr 05, 2011 12:10 pm
Full Name: Shawn Cannon
Contact:

Script to import backup file into Veeam and then restore VMs

Post by rolltidega »

I apologize if this is already available but I am not a Powershell guru. I am looking for some guidance. This would pertain to version 9. I have backups being sent to my side via Cloud Connect backup. (I cannot use the replication option to do this for some internal reasons that I cannot explain). What I need to do on a regular basis is import these backups and restore the VMs into vCenter on my side. I want to use a PowerShell script to import the backups into Veeam and then pass the parameters to restore all the VMs in this backup file (always using the latest backup). I would need to specify all the stuff you would normally specify in the GUI, such as Host/Cluster, Datastore, Folder and Network. I will need these VMs to be overwritten by the next restore. Hopefully that makes sense.

Any help would be greatly appreciated. Thanks!
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Script to import backup file into Veeam and then restore

Post by PTide »

Hi,

You can import a backup with this cmdlet. To restore a VM from backup use this cmdlet. To restore all VMs from a backup to the most recent RP you'll need to combine foreach loops and where conditions. This thread might be helpful.

Thank you.
j0dan
Service Provider
Posts: 4
Liked: never
Joined: Nov 03, 2016 1:03 am
Full Name: Dan Buhler
Contact:

Re: Script to import backup file into Veeam and then restore

Post by j0dan »

rolltidega wrote:I apologize if this is already available but I am not a Powershell guru. I am looking for some guidance. This would pertain to version 9. I have backups being sent to my side via Cloud Connect backup. (I cannot use the replication option to do this for some internal reasons that I cannot explain). What I need to do on a regular basis is import these backups and restore the VMs into vCenter on my side. I want to use a PowerShell script to import the backups into Veeam and then pass the parameters to restore all the VMs in this backup file (always using the latest backup). I would need to specify all the stuff you would normally specify in the GUI, such as Host/Cluster, Datastore, Folder and Network. I will need these VMs to be overwritten by the next restore. Hopefully that makes sense.

Any help would be greatly appreciated. Thanks!
Have you made any progress on this? We're interested in doing this too and would be nice to pool our efforts.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script to import backup file into Veeam and then restore

Post by veremin »

What I need to do on a regular basis is import these backups and restore the VMs into vCenter on my side
Import action seems unnecessary, as information regarding backups is already present in db and therefore can be accessed via PowerShell.

Anyway, general algorithm should look similar to the following ones:

1) Find required restore point - Get-VBRRestorePoint
2) Find required Virtual Infrastructure details (Server, Resource Pool, Datastore) - Get-VBRServer, Find-VBRViResourcePool, Find-VBRViDatastore
3) Restore VM, using collected data - Start-VBRRestoreVM

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests