How to Migrate Veeam Backup for Microsoft 365 Configuration Database
Purpose
Solution
Prepare for Migration
- Ensure all jobs and restore tasks are completed, stopped, and disabled.
- On the primary Veeam Backup for Microsoft 365 server (aka controller) and all associated Proxies, stop the Veeam Backup for Microsoft 365 services:
- Veeam Backup for Microsoft 365 Server
Veeam Backup for Microsoft 365 ServiceGet-Service Veeam.Archiver.Proxy | Stop-Service
Veeam Backup for Microsoft 365 Proxy ServiceGet-Service Veeam.Archiver.Service | Stop-Service
- Veeam Backup for Microsoft 365 Windows Proxy
Veeam Backup for Microsoft 365 Proxy ServiceGet-Service Veeam.Archiver.Proxy | Stop-Service
- Veeam Backup for Microsoft 365 Linux Proxy
Veeam.Archiver.Proxysystemctl stop Veeam.Archiver.Proxy
- Veeam Backup for Microsoft 365 Server
- Review the Veeam Backup for Microsoft 365 configuration to identify the current database connection information.
- On the machine where Veeam Backup for Microsoft 365 is installed open the following file in a text editor:
C:\ProgramData\Veeam\Backup365\Config.xml - Look for the node named ControllerPostgres. On that line will be the current database connection information.
- Example 1: Using VB365 Installer-deployed PostgreSQL Instance
<ControllerPostgres ControllerConnectionString="host=vb365srv;port=5432;database=VeeamBackup365;username=postgres;maxpoolsize=100;connectionidlelifetime=10" />
In this example, we can see that the PostgreSQL server is named vb365srv, the configuration database is named VeeamBackup365, and we can tell that SSPI authentication is being used because there is no password= parameter. - Example 2: Using Remote Dedicated PostgreSQL Instance
<ControllerPostgres ControllerConnectionString="host=pgsqlsrv;port=5432;database=VeeamBackup365;username=veeam365svc;password=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAnyPJ1ttvw06By6Ldd2NKOkEHjdXl7buhzxlW4MjXMBBqLZQGWWjXHgyM%3D;maxpoolsize=100;connectionidlelifetime=10;PasswordEncrypted=True" />
In this example, we can see that the PostgreSQL server is named pgsqlsrv, the configuration database is named VeeamBackup365, the user is named veeam365svc, and native password-based authentication is in use because there is a passsword= parameter configured.
- Example 1: Using VB365 Installer-deployed PostgreSQL Instance
- On the machine where Veeam Backup for Microsoft 365 is installed open the following file in a text editor:
The migration procedure documented in this article requires pgAdmin.
To deploy pgAdmin, either download it from the pgAdmin website or run the postgresql installer, which includes pgAdmin, from the Redistr folder on the Veeam Backup for Microsoft 365 installer ISO.
Export from Source
Using pgAdmin, connect to the PostgreSQL server where the Veeam Backup for Microsoft 365 configuration database is located and export the following (the sections that follow explain in detail how to export these):
- SQL Script files to recreate:
- Group Role: proxy_role_<config_db_name>
Example Export Filename: proxyrole.sql - User: proxy_dbuser_<config_db_name>
Example Export Filename: proxyuser.sql
- Group Role: proxy_role_<config_db_name>
- Database Backup Files
- Configuration Database: VeeamBackup365
Example Export Filename: VeeamBackup365.backup - Cache Database(s): cache_<guid>
Example Export Filename: cache_<guid>.backup
- Configuration Database: VeeamBackup365
Note: When connecting to the default included PostgreSQL instance, the default authentication method for the postgres user is SSPI, and you may see the error "SSPI authentication failed for user." If this occurs, review KB4542. If prompted to specify a password after connecting, click OK with the password field empty.
Export the Proxy Group Role
- Under Login/Group Roles, identify the Group Role named proxy_role_veeambackup365
- Right-click on that Group Role and select CREATE script.

- A query tool window will appear with an SQL query to recreate the Group Role.
- In the Query Tool Toolbar, click the Save icon and save the SQL script as proxyrole.sql for use later in the migration.

Export the Proxy User
- Under Login/Group Roles, identify the User named proxy_role_veeambackup365
- Right-click on that Group Role and select CREATE script.

- A query tool window will appear with an SQL query to recreate the Proxy user.
- In the Query Tool Toolbar, click the Save icon and save the SQL script as proxyuser.sql for use later in the migration.

Export Configuration Database
- Expand the Databases node.
- Right-click on the Veeam Backup for Microsoft 365 Configuration Database, by default, named VeeamBackup365.
- Select Backup...

- In the Backup dialog window that appears, provide a path where the database backup will be created, ensure that the format is set to Custom, and then click Backup.

Export Cache Databases
- If any database(s) are present named cache_<guid>, back them up.
Tip: If you right-click on the cache database and select Properties, you can copy the database name to the clipboard so that you can save the .backup file with the database name to make it easier to recreate and restore the database with the correct name during the Import portion of the migration.

Import to Destination
Notes:
- The destination PostgreSQL instance can be hosted on either Windows or Linux.
- When migrating the Configuration Database to a remote PostgreSQL instance, the authentication method Veeam Backup for Microsoft 365 uses to connect to the PostgreSQL instance must be switched to native password-based authentication.
- Due to the variability of possible PostgreSQL configurations, this guide cannot account for all possible custom configurations that may occur when a PostgreSQL instance is already in use by other third-party software. This guide instead aims to document the configuration changes required to modify a default new deployment of PostgreSQL to allow it to host the Veeam Backup for Microsoft 365 Configuration and Cache databases.
- Ensure that the destination PostgreSQL instance is running a version supported by Veeam Backup for Microsoft 365.
Copy Generated Files to Destination
- Copy the generated .sql and .backup files to the new PostgreSQL server.
Recreate the Proxy Group Role
- Using pgAdmin, connect to the destination PostgreSQL instance.
- Right-click on any database and select Query Tool.

- In the Query Tool Toolbar, click the Open button.

- Open the exported Proxy Group Role SQL script, proxyrole.sql.
- With the query now open in the Query Tool, click Execute script in the Query Tool Toolbar to recreate the Proxy Group Role.

Recreate the Proxy User
- With the Query Tool still open from adding the Proxy Group Role, click the Open button again.

- Open the exported Proxy User SQL script, proxyuser.sql.
- Click Execute to recreate the Proxy User.

Recreate and Restore the Configuration Database
- Right-click on the Databases node, and highlight Create>, then click Database...

- Name the database after the Configuration Database that was backed up.

- Right-click on the new database and select Restore...

- Select the .backup file created from the Configuration Database and click Restore.

Recreate and Restore Cache Databases
If any databases named cache_<guid> were backed up from the original PostgreSQL instance:
- Create new cache_<guid> database(s) with their original names.
- Use the .backup file from each cache_ database to restore the cache database(s).
Configure PostgreSQL Authentication
When the Veeam Backup for Microsoft 365 Configuration Database is hosted on a remote PostgreSQL Instance, you must configure authentication within the PostgreSQL configuration to allow Veeam Backup for Microsoft 365 to access the restored Configuration Database.
Create a PostgreSQL User for Veeam Backup for Microsoft 365
- Using pgAdmin, connect to the new PostgreSQL instance.
- Open the Query Tool.
Right-click on a database and select Query Tool. - Paste the following query (don't execute without updating it).
- Update the role name (vb365svc) and password (pa55word) values in the query and Execute it.
Tip: Remember which role name and password you specified, as you'll need that when reconfiguring Veeam Backup for Microsoft 365.
Note: The password must not contain the following characters:- @
- <
- >
- '
- "
Update PostgreSQL Configuration Files to Allow Authentication
- Open pg_hba.conf in a text editor.
- Windows default location: C:\Program Files\PostgreSQL\15\data\pg_hba.conf
- Linux conf file location will depend on the distro and the method used to install PostgreSQL.
- Add the following lines to the bottom of the ph_hba.conf file:
- Save the pg_hba.conf file.
- Restart the PostgreSQL service.
Reconfigure Veeam Backup for Microsoft 365 and Proxies
In this section you'll update the PostgreSQL connection settings on the Veeam Backup for Microsoft 365 machine and any associated Proxies.
Update Connection Settings on Veeam Backup for Microsoft 365 Machine
- On the machine where Veeam Backup for Microsoft 365 is installed, navigate to:
C:\ProgramData\Veeam\Backup365\ - Make a copy of Config.xml and Proxy.xml, just in case changes need to be reverted or a misconfiguration occurs.
Update Config.xml
- Open Config.xml in a text editor.
- On the line starting with <ControllerPostgres, review and update each parameter as needed:
- host= — Hostname of the new PostgreSQL machine.
- port= — Port to connect to the PostgreSQL instance.
- database= — Configuration Database name. (This should not have changed if you followed the steps in this guide.)
- username= — Set the username= parameter to use the new user role you created in the previous section.
- password= — This value should be configured as follows:
For more information on updating the password used by Veeam Backup for Microsoft 365 to connect to PostgreSQL, review KB4669.- If the password= parameter is not present:
- Add ;password=<password> with the password in plaintext after the username parameter.
Note: Once the service is started, the plaintext password in the file will be replaced with an encrypted value.
Example:<ControllerPostgres ControllerConnectionString="host=pgsql;port=5432;database=VeeamBackup365;username=veeam365svc;password=pa55word;maxpoolsize=100;connectionidlelifetime=10" />
- Add ;password=<password> with the password in plaintext after the username parameter.
- If the ;password= parameter is present:
- Replace the encrypted password value with the new password in plaintext.
Note: Once the service is started, the plaintext password in the file will be replaced with an encrypted value. - Remove the ;PasswordEncrypted=True parameter from the end of the same line.
- Replace the encrypted password value with the new password in plaintext.
- If the password= parameter is not present:
- On the line starting with <RemoteProxyDeploymentSettings, review and update each parameter as needed.
Note: Only the host and port values should need to be checked to make sure they are correct. Neither the username nor password should need to be updated since the proxy user role was exported and imported into the new PostgreSQL instance. - Save the updated Config.xml
Update Proxy.xml
- Open Proxy.xml in a text editor.
- On the line starting with <ProxyPostgres, review and update each parameter as needed.
Note: Only the host and port values should need to be checked to make sure they are correct. Neither the username nor password should need to be updated since the proxy user role was exported and imported into the new PostgreSQL instance. - On any line(s) starting with <PersistentCachePostgres, review and update each parameter as needed.
Note: Only the host and port values should need to be checked to make sure they are correct. - Save the updated Proxy.xml
Update Connection Settings on the Proxies
- On each Veeam Backup for Microsoft 365 Proxy, navigate to:
- Windows: C:\ProgramData\Veeam\Backup365\
- Linux: /opt/veeamvboproxy/
- Make a copy of Proxy.xml, just in case changes need to be reverted or a misconfiguration occurs.
Update Proxy.xml
- Open Proxy.xml in a text editor.
- On the line starting with <ProxyPostgres, review and update each parameter as needed.
Note: Only the host and port values should need to be checked to make sure they are correct. Neither the username nor password should need to be updated since the proxy user role was exported and imported into the new PostgreSQL instance. - On any line(s) starting with <PersistentCachePostgres, review and update each parameter as needed.
Note: Only the host and port values should need to be checked to make sure they are correct. - Save the updated Proxy.xml
Finalize Migration
- On the primary Veeam Backup for Microsoft 365 server (aka controller) and all associated Proxies, start the Veeam Backup for Microsoft 365 services:
- Veeam Backup for Microsoft 365 Server
Get-Service Veeam.Archiver.Proxy | Start-Service Get-Service Veeam.Archiver.Service | Start-Service
- Veeam Backup for Microsoft 365 Windows Proxy
Get-Service Veeam.Archiver.Proxy | Start-Service
- Veeam Backup for Microsoft 365 Linux Proxy
systemctl start Veeam.Archiver.Proxy
- Veeam Backup for Microsoft 365 Server
More Information
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.