An Error Occurred: could not generate config: could not parse mysql DSN: no match found

Summary
migration-assist pgloader fails on migration from MySQL to PostgreSQL as part of an upgrade from 9.0.0 to 10.4.2.

Steps to reproduce
I’ve followed the instructions at Automated PostgreSQL migration - Mattermost documentation.

  1. Check the MySQL database schema - success:
  2. Create the PostgreSQL database schema - success
  3. Generate a pgloader configuration - success
  4. Run pgloader - success
  5. Restore full-text indexes - success
  6. Complete plugin migrations - success
  7. Configure Mattermost to utilize the new PostgreSQL database - success

Observed behavior

  1. Check the MySQL database schema - success:
    sudo -u <<mmuser>> migration-assist mysql 'migration:<<password>>@(<<OLDSERVERIP>>:3306)/<<mmdb>>' postgres 'postgres://<<mmuser>>:<<password>>@localhost:5432/mattermost?sslmode=disable'
    2025-02-18 16:16:39 pinging MySQL...
    2025-02-18 16:16:39 connected to mysql successfully...
    2025-02-18 16:16:39 running checks for artifacts...
    2025-02-18 16:16:39 4 checks been made, all good for artifacts
    2025-02-18 16:16:39 running checks for unicode...
    2025-02-18 16:16:58 11 checks been made, all good for unicode
    2025-02-18 16:16:58 running checks for varchar...
    2025-02-18 16:16:58 8 checks been made, all good for varchar
    2025-02-18 16:16:58 running checks for varchar-extended...
    2025-02-18 16:16:59 12 checks been made, all good for varchar-extended
    
  2. Create the PostgreSQL database schema - success
    migration-assist postgres 'postgres://<<mmuser>>:<<password>>@localhost:5432/mattermost' --run-migrations --mattermost-version="9.0.0"
    2025-02-18 16:18:47 pinging postgres...
    2025-02-18 16:18:47 connected to postgres successfully.
    2025-02-18 16:18:47 schema owner check passed.
    2025-02-18 16:18:47 checking if tables are empty...
    2025-02-18 16:18:47 cloning repository@9.0.0
    2025-02-18 16:18:48 git version: git version 2.43.0
    2025-02-18 16:18:49 checking out...
    2025-02-18 16:18:51 removing existing migrations...
    2025-02-18 16:18:51 moving migration files into a better place..
    2025-02-18 16:18:51 running migrations..
    2025-02-18 16:18:51 migrations applied.
    
  3. Generate a pgloader configuration - failed
    sudo -u <<mmuser>> migration-assist pgloader --mysql='migration:<<password>>@(OLDSERVERIP:3306)/<<mmdb>>' --postgres='postgres://<<mmuser>>:<<password>>@localhost:5432/mattermost'  > migration.load
    An Error Occurred: could not generate config: could not parse mysql DSN: no match found
    

The MySQL DSN for Step 3 is a copy/paste from Step 1 with no special characters (anymore)… I had to change the password to have no special characters for Step 1 to work.

First thing I’d do is get Mattermost upgraded to 9.11.8 (after getting to 9.5.13) Version archive - Mattermost documentation That’ll get you much newer migration tools with bug fixes and updates.

1 Like