Score:0

PowerShell - Restoring Incremental SQL Backups from MABS (DPM)

in flag

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:

  1. Connect-DPMServer
  2. Fetch Protection Group with Get-DPMProtectionGroup
  3. Fetch Datasource with Get-DPMDatasource
  4. Fetch Recovery Point(s) with Get-DPMRecoveryPoint
  5. Configure the restore settings with AlternateDatabaseDetailsType type and New-DPMRecoveryOption
  6. 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?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.