PowerShell script exchange
Post Reply
iihaus
Influencer
Posts: 12
Liked: 1 time
Joined: Oct 19, 2023 2:05 pm
Full Name: Haus Fupepe
Contact:

Best way to perform nightly restores of postgres DBs

Post by iihaus »

Hello all,

I am looking for anyone that has experience in scripting out nightly restores of Postgres DBs from veeam backups. I have written scripts for our SQL DBs but finding it more of a challenge to do the same with our Postgres DBs. I have been thinking about following this method to obtain backups: https://www.virtualhome.blog/category/veeam/page/2/ and then doing a File Level Recovery to the machine we want the restore to but having trouble with the VBR Linux commands. I have the following working but can't seem to figure out how to move the files from the FLR to the machine we need them restored to.

Code: Select all

$backup = Get-VBRBackup -Name $BackupJobName
$restorepoint = Get-VBRRestorePoint -Backup $backup | Where-Object {$_.VMName -eq $VMName} | Sort-Object creationtime -Descending | Select-Object -First 1
$server = Get-VBRServer -Name $MountServer
$session = Start-VBRLinuxFileRestore -RestorePoint $restorepoint -MountServer $server
$items = Get-VBRLinuxGuestItem -LinuxFlrObject $session -Path "/backups/"
I wondering if there is a better method for doing Postgres DB scripted restores or how to get our backup dumps out of the FLR directory and onto our machine for restore. Any help or suggestions would be greatly appreciated!
Rmachado
Service Provider
Posts: 23
Liked: 4 times
Joined: Dec 15, 2016 11:39 pm
Contact:

Re: Best way to perform nightly restores of postgres DBs

Post by Rmachado »

Hello.

Just thinking, you can make one restore, write down all the paths, make a file copy job in VBR and start it in the script to copy.
iihaus
Influencer
Posts: 12
Liked: 1 time
Joined: Oct 19, 2023 2:05 pm
Full Name: Haus Fupepe
Contact:

Re: Best way to perform nightly restores of postgres DBs

Post by iihaus »

Thanks for the response @Rmachado. Kind of what I was thinking as well. Having trouble getting the file out of the backup to another machine currently. I can find plenty of windows examples but Linux examples have been elusive.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests