Blog Post

Azure Database Support Blog
1 MIN READ

Restore LTR backup after database migrated to Hyperscale edition

Yochanan_Rachamim's avatar
Mar 12, 2024

Symptoms: 

When database migrated from any other edition to Hyperscale and later you attempt to restore your database from LTR backup from the time the database was using another edition the restore operation will fail. 

Submitting the restore will only allow you to use Hyperscale service tier as this was the latest in use. 

However, the LTR backup was taken when the database was using another edition. 

 

Error messages: 

Restoring a Hyperscale database backup to a non-Hyperscale service tier or vice versa is not supported.

 

Root Cause:

Azure portal uses the latest edition to decide to which edition to target the restore, in this case it has mismatch in the edition. 

 

Resolution: 

Use command line tool (CLI or PowerShell) to restore your LTR backup and force the correct edition on the restored database. 

The following is a sample using PowerShell restoring database to the same server using Premium P1 as target SLO.

 

## Restore LTR backup on same server using P1 SLO

$Location = 'WestEurope'
$ResourceGroupName = 'Group'
$TargetSlo = 'P1'

$ltrBackup = Get-AzSqlDatabaseLongTermRetentionBackup -Location $Location | Out-GridView -OutputMode Single

Restore-AzSqlDatabase -FromLongTermRetentionBackup `
    -ResourceId $ltrBackup.ResourceId `
    -ServerName $ltrBackup.ServerName `
    -ResourceGroupName $ResourceGroupName `
    -TargetDatabaseName ($ltrBackup.DatabaseName+"_LTRRestores") `
    -ServiceObjectiveName $TargetSlo 

 

 

Updated Mar 12, 2024
Version 1.0
No CommentsBe the first to comment