Microsoft Docs

Backup and Restore in SQL Server Analysis Services

The Analysis Services backup and restore feature enables you to protect your data models, cubes, and related metadata by creating a point‑in‑time copy of a database. This page outlines the process, best practices, and PowerShell examples for managing backups and restores.

When to Use Backup/Restore

Backup Options

OptionDescription
Full backupCreates a complete copy of the database.
Incremental backupOnly new partitions are added to an existing backup file.
CompressionReduces file size; supported on SQL Server 2016+.
EncryptionEncrypts backup files using a certificate.

Backing Up a Database

Use SQL Server Management Studio (SSMS) or PowerShell.

# PowerShell Example: Full Backup
Import-Module SqlServer
$server = "AS-Server\INSTANCE"
$database = "AdventureWorksDW2019"
$backupPath = "C:\Backups\AdventureWorksDW2019.abf"

Backup-ASDatabase `
    -ServerInstance $server `
    -Database $database `
    -BackupFile $backupPath `
    -Compress `
    -EncryptPassword (Read-Host -AsSecureString "Enter encryption password")

Restoring a Database

Restoring overwrites any existing database with the same name unless -NewDatabaseName is specified.

# PowerShell Example: Restore Database
Import-Module SqlServer
$server = "AS-Server\INSTANCE"
$restorePath = "C:\Backups\AdventureWorksDW2019.abf"
$newDb = "AdventureWorksDW2019_Restore"

Restore-ASDatabase `
    -ServerInstance $server `
    -BackupFile $restorePath `
    -DatabaseName $newDb `
    -ReplaceExisting

Best Practices

Common Errors & Solutions

ErrorCauseResolution
0x84BF0005Insufficient disk space.Free space or use compression.
0x84BF006BInvalid encryption password.Confirm password matches backup.
0x84BF0015Database locked.Stop active connections before restore.

Related Topics