#1 Global Leader in Data Resilience

How to Migrate the Configuration and Repository Cache Databases

KB ID: 4676
Product: Veeam Backup for Microsoft 365 | 8
Published: 2024-11-14
Last Modified: 2024-12-05
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.

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.

Article Applicability

This article is intended for use in environments where Veeam Backup for Microsoft 365 8 is already installed. The information provided in this article documents migrating the Configuration and Cache Databases from one PostgreSQL instance to another.

For information about upgrading to Veeam Backup for Microsoft 365 version 8 from an older version please review: Upgrading Veeam Backup for Microsoft 365

Purpose

This article documents the procedure for migrating the Configuration and Cache Databases of Veeam Backup for Microsoft 365 verison 8 from one PostgreSQL instance to another.

Solution

Prepare for Migration

  1. Ensure all jobs and restore tasks are completed, stopped, and disabled.
  2. 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 Proxy Service
      Get-Service Veeam.Archiver.Proxy | Stop-Service
      
      Veeam Backup for Microsoft 365 Service
      Get-Service Veeam.Archiver.Service | Stop-Service
      
    • Veeam Backup for Microsoft 365 Windows Proxy

      Veeam Backup for Microsoft 365 Proxy Service
      Get-Service Veeam.Archiver.Proxy | Stop-Service
      
    • Veeam Backup for Microsoft 365 Linux Proxy

      Veeam.Archiver.Proxy
      systemctl stop Veeam.Archiver.Proxy
      
  3. Review the Veeam Backup for Microsoft 365 configuration to identify the current database connection information.
    1. 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
    2. 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.
pgAdmin Required

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
  • Database Backup Files
    • Configuration Database: VeeamBackup365
      Example Export Filename: VeeamBackup365.backup
    • Cache Database(s): cache_<guid>
      Example Export Filename: cache_<guid>.backup

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

  1. Under Login/Group Roles, identify the Group Role named proxy_role_veeambackup365
  2. Right-click on that Group Role and select CREATE script.
Backup Role
  1. A query tool window will appear with an SQL query to recreate the Group Role.
  2. In the Query Tool Toolbar, click the Save icon and save the SQL script as proxyrole.sql for use later in the migration.
Save SQL Role

Export the Proxy User

  1. Under Login/Group Roles, identify the User named proxy_role_veeambackup365
  2. Right-click on that Group Role and select CREATE script.
Export Proxy User
  1. A query tool window will appear with an SQL query to recreate the Proxy user.
  2. In the Query Tool Toolbar, click the Save icon and save the SQL script as proxyuser.sql for use later in the migration.
Save SQL Role

Export Configuration Database

  1. Expand the Databases node.
  2. Right-click on the Veeam Backup for Microsoft 365 Configuration Database, by default, named VeeamBackup365.
  3. Select Backup...
Backup DB
  1. 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.
Backup Database Form

Export Cache Databases

  1. 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.
cache db backup
Tip
If Veeam Backup for Microsoft 365 was using the included local PostgreSQL deployment, and that PostgreSQL instance will not be used by any other software, stop and disable the postgresql-x64-15 service. This will prevent the software from mistakenly connecting to the old PostgreSQL instance if a configuration file is not correctly updated during the migration finalization stage.

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

  1. Copy the generated .sql and .backup files to the new PostgreSQL server.

Recreate the Proxy Group Role

  1. Using pgAdmin, connect to the destination PostgreSQL instance.
  2. Right-click on any database and select Query Tool.
Open Query Tool
  1. In the Query Tool Toolbar, click the Open button.
Open Query File
  1. Open the exported Proxy Group Role SQL script, proxyrole.sql.
  2. With the query now open in the Query Tool, click Execute script in the Query Tool Toolbar to recreate the Proxy Group Role.
recreate proxy group role

Recreate the Proxy User

  1. With the Query Tool still open from adding the Proxy Group Role, click the Open button again.
Open Query File
  1. Open the exported Proxy User SQL script,  proxyuser.sql.
  2. Click Execute to recreate the Proxy User.
recreate proxy user

Recreate and Restore the Configuration Database

  1. Right-click on the Databases node, and highlight Create>, then click Database...
create new database
  1. Name the database after the Configuration Database that was backed up.
create database name
  1. Right-click on the new database and select Restore...
Restore Database
  1. Select the .backup file created from the Configuration Database and click Restore.
start restore

Recreate and Restore Cache Databases

If any databases named cache_<guid> were backed up from the original PostgreSQL instance:

  1. Create new cache_<guid> database(s) with their original names.
  2. 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
  1. Using pgAdmin, connect to the new PostgreSQL instance.
  2. Open the Query Tool.
    Right-click on a database and select Query Tool.
  3. Paste the following query (don't execute without updating it).
CREATE ROLE "vb365svc" WITH
LOGIN
SUPERUSER
CREATEDB
CREATEROLE
INHERIT
REPLICATION
BYPASSRLS
CONNECTION LIMIT -1
PASSWORD 'pa55word';
  1. 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

  1. 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.
  2. Add the following lines to the bottom of the ph_hba.conf file:
# Allow remote access using Password-based authentication.
host all all 0.0.0.0/0 scram-sha-256
host all all ::/0 scram-sha-256
  1. Save the pg_hba.conf file.
  2. 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.

Configuration Formatting
All parameters within the discussed configuration files (Config.xml and Proxy.xml) are separated by a semicolon ( ; ) symbol. Ensure that the format of the xml file is preserved and that parameters are correctly separated using that semicolon. Any malformation in the configuration file may cause the service to fail to start or load the settings.

Update Connection Settings on Veeam Backup for Microsoft 365 Machine

  1. On the machine where Veeam Backup for Microsoft 365 is installed, navigate to:
    C:\ProgramData\Veeam\Backup365\
  2. Make a copy of Config.xml and Proxy.xml, just in case changes need to be reverted or a misconfiguration occurs.
Update Config.xml
  1. Open Config.xml in a text editor.
  2. On the line starting with <ControllerPostgres, review and update each parameter as needed:
    1. host=  —  Hostname of the new PostgreSQL machine.
    2. port=  —  Port to connect to the PostgreSQL instance.
    3. database=  —  Configuration Database name. (This should not have changed if you followed the steps in this guide.)
    4. username=  —  Set the username= parameter to use the new user role you created in the previous section.
    5. 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:
        1. 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" />
          
      • If the ;password= parameter is present:
        1. 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.
        2. Remove the ;PasswordEncrypted=True parameter from the end of the same line.
  3. 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.
  4. Save the updated Config.xml
Update Proxy.xml
  1. Open Proxy.xml in a text editor.
  2. 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.
  3. 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.
  4. Save the updated Proxy.xml

Update Connection Settings on the Proxies

  1. On each Veeam Backup for Microsoft 365 Proxy, navigate to:
    • Windows: C:\ProgramData\Veeam\Backup365\
    • Linux: /opt/veeamvboproxy/
  2. Make a copy of Proxy.xml, just in case changes need to be reverted or a misconfiguration occurs.
Update Proxy.xml
  1. Open Proxy.xml in a text editor.
  2. 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.
  3. 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.
  4. Save the updated Proxy.xml

Finalize Migration

  1. 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
      

More Information

Should any issues occur during the migration, please create a Veeam Support case. To help expedite the investigation, please include a zip of the contents of C:\ProgramData\Veeam\Backup365\Logs\.
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.