#1 Global Leader in Data Resilience

How to Manually Back Up Veeam Configuration Databases

KB ID: 1471
Product: Veeam Backup & Replication
Veeam Service Provider Console
Veeam Cloud Connect
Published: 2012-01-06
Last Modified: 2024-08-02
Languages: JP
mailbox
Get weekly article updates
By subscribing, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Notice.
This site is protected by hCaptcha and its Privacy Policy and Terms of Service apply except as noted in our Privacy Policy.

Cheers for trusting us with the spot in your mailbox!

Now you’re less likely to miss what’s been brewing in our knowledge base with this weekly digest

error icon

Oops! Something went wrong.

Please, try again later.

Purpose

This article documents methods to back up Microsoft SQL and PostgreSQL databases.

This article also documents how to locate the configuration database for

  • Veeam Backup & Replication / Veeam Cloud Connect
  • Enterprise Manager
  • Veeam Service Provider Console.

For information about Veeam ONE, please see: KB2356

Identify Veeam Database Location

Veeam Backup & Replication or Veeam Cloud Connect version 12 or Newer

For versions of Veeam Backup & Replication or Veeam Cloud Connect older than version 12, please click here to be taken to the legacy section of this article.
 

Method 1: Identify Using the Configuration Database Connection Settings Utility
  1. Launch the Configuration Database Connection Settings utility.
  2. Select Veeam Backup & Replication, and click Next to see the product's database connection settings.
    If Enterprise Manager is not installed, this option will not be shown, and you will be taken directly to the Connection Settings.
  3. On the Connection Settings tab, take note of the Database engine and Connection settings.
  4. Click Cancel to close the Configuration Database Connection Settings utility making no changes.
    Failure to click Cancel will cause all Veeam services to be restarted, causing all active jobs to be forcefully stopped.
     
Method 2: Identify Using PowerShell

Run the following PowerShell script on the server where either Veeam Backup & Replication or Veeam Cloud Connect is installed and it will output the database connection information.

The script below simply pulls information from specific registry values and displays those values in the PowerShell console. No changes will be made to the system.

$activeConfig = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations' -Name 'SqlActiveConfiguration').SqlActiveConfiguration
if ($activeConfig -eq "MsSql") {
$sqlServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql' -Name 'SqlServerName').SqlServerName
$sqlInstanceName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql' -Name 'SqlInstanceName').SqlInstanceName
$sqlDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql' -Name 'SqlDatabaseName').SqlDatabaseName
Write-Host " Database Engine: $($activeConfig) "
Write-Output "Connection Settings: $($sqlServerName)\$($sqlInstanceName)"
Write-Output "Database Name: $($sqlDatabaseName)"
} elseif ($activeConfig -eq "PostgreSql") {
$pgServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'SqlHostName').SqlHostName
$pgPortNumber = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'SqlHostPort')
$pgDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'SqlDatabaseName').SqlDatabaseName
$pgUser = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'PostgresUserForWindowsAuth').PostgresUserForWindowsAuth
Write-Host "Database Engine: $($activeConfig)"
Write-Output "Connection Settings: $($pgServerName):$($pgPortNumber)"
Write-Output "Database Name: $($pgDatabaseName)"
Write-Output "PostgreSQL User: $($pgUser)"
}

For Enterprise Manager version 12 or Newer

For versions Enterprise Manager older than version 12, please click here to be taken to the legacy section of this article.
 

Method 1: Identify Using the Configuration Database Connection Settings Utility
  1. Launch the Configuration Database Connection Settings utility.
  2. Select Veeam Backup Enterprise Manager to see that product's database connection settings.
  3. On the Connection Settings tab, take note of Database engine and Connection settings.
  4. Click Cancel to close the Configuration Database Connection Settings utility making no changes.
     
Method 2: Identify Using PowerShell

Run the following PowerShell script on the server where Enterprise Manager is installed and it will output the database connection information.

The script below simply pulls information from specific registry values and displays those values in the PowerShell console. No changes will be made to the system.

$activeConfig = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations' -Name 'SqlActiveConfiguration').SqlActiveConfiguration
if ($activeConfig -eq "MsSql") {
$sqlServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\MsSql' -Name 'SqlServerName').SqlServerName
$sqlInstanceName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\MsSql' -Name 'SqlInstanceName').SqlInstanceName
$sqlDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\MsSql' -Name 'SqlDatabaseName').SqlDatabaseName
Write-Host " Database Engine: $($activeConfig) "
Write-Output "Connection Settings: $($sqlServerName)\$($sqlInstanceName)"
Write-Output "Database Name: $($sqlDatabaseName)"
} elseif ($activeConfig -eq "PostgreSql") {
$pgServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'SqlHostName').SqlHostName
$pgPortNumber = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'SqlHostPort')
$pgDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'SqlDatabaseName').SqlDatabaseName
$pgUser = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'PostgresUserForWindowsAuth').PostgresUserForWindowsAuth
Write-Host "Database Engine: $($activeConfig)"
Write-Output "Connection Settings: $($pgServerName):$($pgPortNumber)"
Write-Output "Database Name: $($pgDatabaseName)"
Write-Output "PostgreSQL User: $($pgUser)"
}

Veeam Service Provider Console

Configuration > Settings > SQL Server Connection

Veeam Backup & Replication, Veeam Cloud Connect, and Enterprise Manager versions 11a and Older

This section contains information specific to all versions of Veeam Backup & Replication, Veeam Cloud Connect, and Enterprise Manager prior to version 12.

  • Veeam Backup & Replication and Veeam Cloud Connect
    • If the software is installed, open the Veeam.Backup.DBConfig.exe utility.
      While the tool is usually used to change which database is used, initially, it will show you the currently configured database connection details. After checking the connection details, click Cancel to close the DBConfig utility without making changes.
    • Alternatively, check the following registry values in the following key:
      HKLM\SOFTWARE\Veeam\Veeam Backup and Replication\
      • SqlServerName
      • SqlInstanceName
      • SqlDatabaseName
  • Veeam Backup Enterprise Manager
    • If the software is installed, open the Veeam.Backup.DBConfig.exe utility.
      While the tool is usually used to change which database is used, initially, it will show you the currently configured database connection details. After checking the connection details, click Cancel to close the DBConfig utility without making changes.
    • Alternatively, check the following registry values in the following key:
    • HKLM\SOFTWARE\Veeam\Veeam Backup Reporting\
      • SqlServerName
      • SqlInstanceName
      • SqlDatabaseName

Database Backup

Compress Database Backup Before Attaching to Case

If you are providing the database backup to Veeam Support, we ask that you please compress (ZIP) the resulting database backup file before attaching it to the case. This will save bandwidth and time for both you and the support engineer assisting you.

Most database backup files will compress to 15% of their original size.

Instructions for Microsoft SQL (MsSql)

Method 1: PowerShell

*The Backup-SqlDatabse PowerShell cmdlet is part of a module installed with Microsoft SQL and must be run on the Microsoft SQL server itself. The command will fail if Microsoft SQL is not installed on the machine where the cmdlet is executed.

Run the following command, filling in Microsoft SQL connection information and output destination:

*The following command assumes that the Microsoft SQL Instance uses Windows authentication and that the account used to execute the command has the appropriate privileges to perform a database backup.

Backup-SqlDatabase -ServerInstance "ServerName\InstanceName" -Database "DBName" -BackupFile "C:\Temp\DBBackup_$($env:computername)_$(get-date -f yyyy-MM-dd_HH.mm).bak"
powershell output example
Example using PowerShell
Method 2: Microsoft SQL Server Management Studio
  1. Open Microsoft SQL Server Management Studio (May need to be installed separately)
    *It may be necessary to launch SQL Server Management Studio using "Run as Administrator" to prevent permissions-related issues.
  2. Connect to the ServerName\Instance hosting the Database.
  3. Expand the Databases section.
  4. Right-click on the desired DB, then from the context menu, select Tasks > Back Up...
tasks backup
  1. Set Backup Type: to Full
  2. Set the output to a single file on disk.
    (You may need to click remove first, then click add to specify an output location on disk.)
Full backup to single file on disk
  1. Click OK to start the Backup process.
Method 3: sqlcmd

*sqlcmd is an application that is installed with Microsoft SQL. If Microsoft SQL is not installed on the machine where the command is executed, sqlcmd will not exist, and the command will fail.

Run the following command, filling in Microsoft SQL connection information and output destination:

*The following command assumes that the Microsoft SQL Instance uses Windows authentication and that the account used to execute the command has the appropriate privileges to perform a database backup.

SqlCmd -E -S ServerName\InstanceName -Q "BACKUP DATABASE [DBName] TO DISK='C:\Temp\DBBackupFilename.bak' WITH STATS"
SQLCmd Example
Example using SqlCmd
Compress Database Backup Before Attaching to Case

If you are providing the database backup to Veeam Support, we ask that you please compress (ZIP) the resulting database backup file before attaching it to the case. This will save bandwidth and time for both you and the support engineer assisting you.

Most database backup files will compress to 15% of their original size.

Instructions  for PostgreSQL (PostgreSql)

Note:

  • The pg_dump example command below does not specify the server name or port as it assumes they are the Veeam Backup & Replication install default connection settings: localhost:5432
  • pg_dump is an application that is installed with PostgreSQL. If PostgreSQL is not installed on the machine where the command is executed, pg_dump will not exist, and the command will fail.
  • Adjust the backup location to any disk/path with sufficient free space.

 

In an Administrator elevated PowerShell console, run the following command:

& "C:\Program Files\PostgreSQL\15\BIN\pg_dump.exe" -U postgres -F c -b -f "C:\Temp\PGDBBackup_$($env:computername)_$(get-date -f yyyy-MM-dd_HH.mm).sql" VeeamBackup
Troubleshooting "SSPI authentication failed" Error

The SSPI Authentication error most often occurs when the user account that executed the pg_dump command is not mapped correctly.

pg_dump: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  SSPI authentication failed for user "postgres"

To resolve this issue, review KB4542.

More information

For more information on how we process the collected data, please visit: vee.am/processing_of_personal_data
To submit feedback regarding this article, please click this link: Send Article Feedback
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.

Spelling error in text

This site is protected by hCaptcha and its Privacy Policy and Terms of Service apply except as noted in our Privacy Policy.
Thank you!

Thank you!

Your feedback has been received and will be reviewed.

Oops! Something went wrong.

Please, try again later.

You have selected too large block!

Please try select less.

KB Feedback/Suggestion

This form is only for KB Feedback/Suggestions, if you need help with the software open a support case

By submitting, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Notice.
This site is protected by hCaptcha and its Privacy Policy and Terms of Service apply except as noted in our Privacy Policy.
Verify your email to continue your product download
We've sent a verification code to:
  • Incorrect verification code. Please try again.
An email with a verification code was just sent to
Didn't receive the code? Click to resend in sec
Didn't receive the code? Click to resend
Thank you!

Thank you!

Your feedback has been received and will be reviewed.

error icon

Oops! Something went wrong.

Please, try again later.