I am a DBA trying to automate the restore process for databases backed up by Microsft Azure Backup Server. I am able to restore full backups, however, I cannot work out how to restore subsequent incremental backups to a point in time.
The process I follow so far:
- Connect-DPMServer
- Fetch Protection Group with Get-DPMProtectionGroup
- Fetch Datasource with Get-DPMDatasource
- Fetch Recovery Point(s) with Get-DPMRecoveryPoint
- Configure the restore settings with AlternateDatabaseDetailsType type and New-DPMRecoveryOption
- Restore with Restore-DPMRecoverableItem passing the recovery point and recovery option.
Step 6 works fine for the full backup only. For incrementals, it fails because it cannot accept an array of recovery points. If I try iterating over the list of RPs and running the restore command, the second call fails with an error that the target database already exists (despite leaving the DB in a restoring state).
The documentation isn't much help as the examples only deal with VMs, files or in some cases Exchange objects, but nothing for SQL Server databases.
Has anyone scripted this before and have a working example they could share?