Automating Configuration Database Restore
If you want to automate the process of the configuration database restore, you can do it using the Veeam.Backup.Configuration.UnattandedRestore.exe file in Veeam Backup & Replication 12.1 or the config.cfg file in Veeam Backup & Replication 12.
Limitations and Considerations
Before you start the restore process, check the prerequisites.
Restoring Configuration Database in Veeam Backup & Replication 12.1
To restore Veeam Backup & Replication configuration database using the Veeam.Backup.Configuration.UnattendedRestore.exe file, perform the following steps:
Step 1. Generate Configuration File
To generate the configuration file, do the following:
- Open the command prompt.
- Change the directory to the directory where the Veeam.Backup.Configuration.UnattendedRestore.exe file is stored. By default, C:\Program Files\Veeam\Backup and Replication\Backup.
cd "C:\Program Files\Veeam\Backup and Replication\Backup" |
- Use the following command to generate the configuration file. In the generate parameter, specify the path where the configuration file will be saved.
Veeam.Backup.Configuration.UnattendedRestore.exe /generate:C:\backup\unattended.xml |
Alternatively, you can complete the configuration restore wizard and click Export answer file on the Summary step of the wizard. In this case, the configuration file will contain parameters you specified during the restore process.
Step 2. Specify Restore Settings
After you execute the command, the configuration file will be generated with default preferences by the path you specified. You can manually edit the file to specify the necessary parameters.
Step 3. Restore Configuration Database
To restore the configuration database, do the following:
- Open the command prompt.
- Change the directory to the directory where the Veeam.Backup.Configuration.UnattendedRestore.exe file is stored. By default, C:\Program Files\Veeam\Backup and Replication\Backup.
cd "C:\Program Files\Veeam\Backup and Replication\Backup" |
- Use the following command to restore the configuration file. In the file parameter, specify the path where the configuration file is stored.
Veeam.Backup.Configuration.UnattendedRestore.exe /file:C:\backup\unattended.xml |
Veeam Backup & Replication will use the preferences specified in the unattended.xml file to perform the configuration database restore.
The path to the log file is %ProgramData%\Veeam\Backup\Utils\Util.VeeamBackupConfiguration.UnattendedRestore.log.
Configuration File Parameters
Parameter | Description | Required |
---|---|---|
CONFIGURATION_FILE | Specifies a full path to the configuration backup file. Supported values:
| Yes |
REPOSITORY_NAME | Specifies Veeam Backup & Replication repository name where the configuration backup file is stored. If you do not specify this parameter, empty name will be used. Supported values: String. | No |
BACKUP_PASSWORD | Specifies the password to decrypt the configuration backup file. Supported values: String. | No |
NETWORK_USER | Specifies the user account for the network share. Supported values: domain\username. | No |
NETWORK_PASSWORD | Specifies the password for the network share. Supported values: String. | No |
SQLSERVER_ENGINE | Specifies the database engine. Supported values: mssql or postgresql. Default: postgresql. | No |
DATABASE_SERVER | Specifies the database server and instance on which the configuration database will be deployed. Supported values:
| Yes |
SQLSERVER_DATABASE | Specifies the name for the configuration database. Supported values: String. Default: VeeamBackup. | No |
SQLSERVER_AUTHENTICATION | Specifies the authentication mode to connect to the database server where the Veeam Backup & Replication configuration database will be deployed. Supported values:
Default: 0. | No |
VBR_SQLSERVER_USERNAME | Specifies a LoginID to connect to the SQL server in the native authentication mode Supported values: String. Note: The parameter is required if the SQLSERVER_AUTHENTICATION parameter value is 1. | No |
VBR_SQLSERVER_PASSWORD | Specifies a password to connect to the SQL server in the native authentication mode. Supported values: String. Note: The parameter is required if you specify the VBR_SQLSERVER_USERNAME parameter. | No |
PG_DUMP_PATH | Specifies a path to the pg_dump.exe file. Supported values: String. | No |
RESTORE_BACKUPS | Defines that Veeam Backup & Replication will restore backup and replica restore points catalog. Supported values:
Default: 1. | No |
RESTORE_SESSIONS | Defines that Veeam Backup & Replication will restore sessions history. Supported values:
Default: 0. | No |
ENABLE_POWERSHELL_POLICY | Defines that PowerShell execution policy will be set to work for SCVMM. Supported values:
Default: 1. | No |
BACKUP_EXISTING_DATABASE | Defines that the current database will be backed up. Supported values:
Default: 0. | No |
SERVICES_AUTOSTART | Defines that Veeam Backup & Replication will start automatically after the migration. Supported values:
Default: 1. | No |
CREATE_NEW_DATABASE | Defines that the new database will be created if it does not exist. Supported values:
Default: 1. | No |
USE_EXISTING_DATABASE | Defines that Veeam Backup & Replication will use an existing database if it is not empty. Supported values:
Default: 0. | No |
USE_LOCKED_DATABASE | Defines that Veeam Backup & Replication will use an existing database owned by another backup server. Supported values:
Default: 1. | No |
OVERWRITE_EXISTING_DATABASE | Defines that the new database will overwrite the existing one. Supported values:
Default: 0. | No |
STOP_PROCESSES | Defines that Veeam Backup & Replication will terminate all running backup server processes. Supported values:
Default: 0. | No |
SWITCH_TO_RESTORE_MODE | Defines that the configuration restore will switch to the restore mode if enabled backup jobs are found. Supported values:
Default: 2. | No |
RETRY_COUNT | Specifies the amount of retries that configuration restore should perform. Supported values: Int32. Default: 3. | No |
ACCEPT_FOUND_DATABASE_ISSUES | Defines that the configuration restore will proceed if database issues are found. Supported values:
Default: 0. | No |
CREDENTIALS | Specify this parameter if you want to update stored passwords during the configuration restore. If you do not specify this parameter, passwords will not be updated Supported values: user=password;{hint}. | No |
PRIVATE_KEYS | Specify this parameter if you want to update stored private keys during the configuration restore. If you do not specify this parameter, private keys will not be updated. Supported values: user=privatekey;password;{hint}. | No |
HOSTS | Forces target server components upgrade if necessary. If you do not specify this parameter, all hosts will be upgraded. Note: If you specify only several hosts out of all hosts in your backup infrastructure, only these hosts will be upgraded. Do not specify this parameter if you want to upgrade all hosts. Supported values: DNS name\IP address. | No |
Restoring Configuration Database in Veeam Backup & Replication 12
To restore Veeam Backup & Replication configuration database using the config.cfg file, perform the following steps:
Step 1. Generate Configuration File
To generate the configuration file, do the following:
- Open the command prompt.
- Change the directory to the directory where the Veeam.Backup.Configuration.Restore.exe file is stored. By default, C:\Program Files\Veeam\Backup and Replication\Backup.
cd "C:\Program Files\Veeam\Backup and Replication\Backup" |
- Use the following command to generate the configuration file. In the genconfig parameter, specify the path where the configuration file will be saved.
Veeam.Backup.Configuration.Restore.exe /genconfig:C:\config.cfg |
When you perform the command, the configuration restore wizard will appear.
Step 2. Complete Configuration Restore Wizard
Complete the configuration restore wizard.
After you complete the configuration restore wizard, the configuration file will be generated by the path you specified in the genconfig parameter. The configuration file will contain all the preferences you specified in the configuration restore wizard. You can also edit it manually later.
Step 3. Restore Configuration Database
To restore the configuration database, do the following:
- Open the command prompt.
- Change the directory to the directory where the Veeam.Backup.Configuration.Restore.exe file is stored. By default, C:\Program Files\Veeam\Backup and Replication\Backup.
cd "C:\Program Files\Veeam\Backup and Replication\Backup" |
- Use the following command to restore the configuration file. In the config parameter, specify the path where the configuration file will be saved.
Veeam.Backup.Configuration.Restore.exe /config:C:\config.cfg |
Veeam Backup & Replication will use the preferences you specified in the config.cfg file to perform the configuration database restore.
The path to the log file is %ProgramData%\Veeam\Backup\Utils\Util.VeeamBackupConfiguration.Restore.log.
Configuration File Parameters
Parameter | Description |
---|---|
RestoreMode | Specifies the configuration restore mode. Accepts values: Restore or Migrate. Default: Restore. |
FileMode | Specifies the configuration backup file path type. Accepts values: Local or Network. Default: Local. |
ConfigurationFile | Specifies the full path to the configuration backup file. |
ConfigurationFilePassword | Specifies the password to decrypt the configuration backup file. |
DatabaseType | Specifies the target database engine. Accepts values: Microsoft SQL or PostgreSQL. Default: PostgreSQL. |
DatabaseName | Specifies the target database name to use for the configuration restore. Default: VeeamBackup. |
DatabaseServer | Specifies the database server instance. For Microsoft SQL, use the localhost\instanceName format. For PostgreSQL, use the localhost\instancePort format. |
UseWindowsAuthentication | Defines that Veeam Backup & Replication will use Windows authentication to perform the configuration restore. Accepts values: True or False. Default: True. Note: This parameter is required if you do not use the SQL Server authentication. |
SqlUser | Specifies the user name for the SQL Server authentication. |
SqlPassword | Specifies the password for the SQL Server authentication. |
PgDumpPath | Specifies the path to the PostgreSQL pg_dump utility. |
RestoreBackups | Defines that Veeam Backup & Replication will restore backup and replica restore points catalog. Accepts values: True or False. Default: False. |
RestoreSessions | Defines that Veeam Backup & Replication will restore session history. Accepts values: True or False. Default: False. |
EnablePowerShellPolicy | Defines that Veeam Backup & Replication will enable PowerShell execution policy setting required for SCVMM. Accepts values: True or False. Default: False. |
BackupExistingDb | Defines that Veeam Backup & Replication will back up existing database before performing the configuration restore. Accepts values: True or False. Default: False. |
LaunchVbrConsole | Defines that Veeam Backup & Replication will launch the console after the configuration restore is complete. Accepts values: True or False. Default: False. |
CreateDbIfNotExists | Defines that Veeam Backup & Replication will create a new database if selected database does not exist. Accepts values: Yes or No. Default: Yes. Note: The parameter value No will terminate the configuration restore if the selected database does not exist. |
ProceedWithUnsupportedDb | Defines that Veeam Backup & Replication will proceed the configuration restore with the selected database even if it has unknown type. Accepts values: Yes or No. Default: No. Note: The parameter value Yes will terminate the configuration restore if the selected database has unknown type. |
UseLockedDb | Defines that Veeam Backup & Replication will proceed the configuration restore with the selected database even if it is owned by another backup server. Accepts values: Yes or No. Default: Yes. Note: The parameter value No will terminate the configuration restore if the selected database is owned by another backup server. |
UseVbrDb | Defines that Veeam Backup & Replication will overwrite existing database even if it is Veeam Backup & Replication configuration database. Accepts values: Yes or No. Default: Yes. Note: The parameter value No will terminate the configuration restore if the existing database is Veeam Backup & Replication configuration database. |
SwitchRestoreMode | Defines that Veeam Backup & Replication will switch to the configuration restore mode if one or more enabled backup jobs are found. Accepts values: Yes, No or Cancel. Default: Cancel. Note: The parameter value Cancel will terminate the configuration restore if enabled backup jobs are found. |