MySQL to PostgreSQL problem - Database error 42P01

Hello, and thank you for reading this.

I am migrating from MySQL 8 to Postgres. I am trying to migrate from MySQL to PostgreSQL. However, I cannot solve the problem with my skills, so I would like to ask for help from many experienced forum users.

Environment:

  • Ubuntu 24.04
  • mysql Ver 8.0.39-0ubuntu0.24.04.1 for Linux on x86_64 ((Ubuntu))
  • postgresql 15.10

[1]

./migration-assist mysql “mattermost:mattermost@tcp(localhost:3306)/mattermost”

2025-08-21 07:34:09 pinging mysql…
2025-08-21 07:34:09 connected to mysql successfully…
2025-08-21 07:34:13 running checks for artifacts…
2025-08-21 07:34:13 a fix is required for: schema_migrations
2025-08-21 07:34:13 4 checks been made, 1 fix(es) is required for artifacts
2025-08-21 07:34:13 MySQL version: 8.0.39
2025-08-21 07:34:13 running checks for unicode…
2025-08-21 07:34:14 11 checks been made, all good for unicode
2025-08-21 07:34:14 running checks for varchar…
2025-08-21 07:34:14 8 checks been made, all good for varchar
2025-08-21 07:34:14 running checks for varchar-extended…
2025-08-21 07:34:14 a fix is required for: fileinfo.name
2025-08-21 07:34:14 12 checks been made, 1 fix(es) is required for varchar-extended

[2]

ALTER SCHEMA public OWNER TO mattermost;
GRANT ALL ON SCHEMA public TO mattermost;

./migration-assist postgres “postgres://mattermost:mattermost@localhost:5432/mattermost”
–run-migrations
–mattermost-version=“10.11.1”

2025-08-21 07:45:53 pinging postgres…
2025-08-21 07:45:53 connected to postgres successfully.
2025-08-21 07:45:53 schema owner check passed.
2025-08-21 07:45:53 checking if tables are empty…
2025-08-21 07:45:53 cloning repository@10.11.1
2025-08-21 07:45:53 git version: git version 2.43.0
2025-08-21 07:45:54 checking out…
2025-08-21 07:45:55 removing existing migrations…
2025-08-21 07:45:55 moving migration files into a better place..
2025-08-21 07:45:55 running migrations..
2025-08-21 07:45:57 migrations applied.

[3]

./migration-assist pgloader
–mysql=“mattermost:mattermost@tcp(localhost:3306)/mattermost”
–postgres=“postgres://mattermost:mattermost@localhost:5432/mattermost”
–remove-null-chars \

migration.load

2025-08-21 07:47:42 pinging postgres…
2025-08-21 07:47:42 connected to postgres successfully.

./pgloader migration.load > migration.log

[4]

./migration-assist pgloader boards \

--mysql="mattermost:mattermost@tcp(localhost:3306)/mattermost" \

--postgres="postgres://mattermost:mattermost@localhost:5432/mattermost" \

> boards.load

./pgloader boards.load > boards_migration.log

Problem is here.

./pgloader boards.load > boards_migration.log
KABOOM!
UNDEFINED-TABLE: Database error 42P01: relation “mattermost.focalboard_teams” does not exist
QUERY: UPDATE mattermost.focalboard_teams SET “settings” = ‘{}’::json WHERE “settings”::text = ‘’;
An unhandled error condition has been signalled:
Database error 42P01: relation “mattermost.focalboard_teams” does not exist
QUERY: UPDATE mattermost.focalboard_teams SET “settings” = ‘{}’::json WHERE “settings”::text = ‘’;

What I am doing here?

Database error 42P01: relation “mattermost.focalboard_teams” does not exist
QUERY: UPDATE mattermost.focalboard_teams SET “settings” = ‘{}’::json WHERE “settings”::text = ‘’;

boards_migration.log

2025-08-22T01:28:40.012000Z LOG pgloader version “3.6.d9ca38e”
2025-08-22T01:28:40.015000Z LOG Data errors in ‘/tmp/pgloader/’
2025-08-22T01:28:40.015000Z LOG Parsing commands from file #P"/opt/0.dv/migration/boards.load"
2025-08-22T01:28:40.314002Z LOG Migrating from #<MYSQL-CONNECTION mysql://mattermost@localhost:3306/mattermost {1006D7D723}>
2025-08-22T01:28:40.314002Z LOG Migrating into #<PGSQL-CONNECTION pgsql://mattermost@localhost:5432/mattermost {1006D7DFB3}>
2025-08-22T01:28:42.401016Z ERROR Database error 42P01: relation “mattermost.focalboard_teams” does not exist
QUERY: UPDATE mattermost.focalboard_teams SET “settings” = ‘{}’::json WHERE “settings”::text = ‘’;

boards.load

LOAD DATABASE
FROM mysql://mattermost:mattermost@localhost:3306/mattermost
INTO pgsql://mattermost:mattermost@localhost:5432/mattermost

WITH include drop, create tables, create indexes, reset sequences,
workers = 8, concurrency = 1,
multiple readers per thread, rows per range = 50000,
preserve index names

SET PostgreSQL PARAMETERS
maintenance_work_mem to ‘128MB’,
work_mem to ‘12MB’

SET MySQL PARAMETERS
net_read_timeout = ‘120’,
net_write_timeout = ‘120’

CAST column focalboard_blocks.fields to “json” drop typemod,
column focalboard_blocks_history.fields to “json” drop typemod,
column focalboard_schema_migrations.name to “varchar” drop typemod,
column focalboard_sessions.props to “json” drop typemod using remove-null-characters,
column focalboard_teams.settings to “json” drop typemod using remove-null-characters,
column focalboard_users.props to “json” drop typemod using remove-null-characters,
type int when (= precision 11) to int4 drop typemod,
type json to jsonb drop typemod using remove-null-characters

INCLUDING ONLY TABLE NAMES MATCHING
~/focalboard/

BEFORE LOAD DO
$$ ALTER SCHEMA public RENAME TO mattermost; $$

AFTER LOAD DO
$$ UPDATE mattermost.focalboard_blocks SET “fields” = ‘{}’::json WHERE “fields”::text = ‘’; $$,
$$ UPDATE mattermost.focalboard_blocks_history SET “fields” = ‘{}’::json WHERE “fields”::text = ‘’; $$,
$$ UPDATE mattermost.focalboard_sessions SET “props” = ‘{}’::json WHERE “props”::text = ‘’; $$,
$$ UPDATE mattermost.focalboard_teams SET “settings” = ‘{}’::json WHERE “settings”::text = ‘’; $$,
$$ UPDATE mattermost.focalboard_users SET “props” = ‘{}’::json WHERE “props”::text = ‘’; $$,
$$ ALTER SCHEMA mattermost RENAME TO public; $$,
$$ SELECT pg_catalog.set_config(‘search_path’, ‘“$user”, public’, false); $$,
$$ ALTER USER mattermost SET SEARCH_PATH TO ‘public’; $$;

“UNDEFINED-TABLE: Database error 42P01: relation “mattermost.focalboard_teams” does not exist” - I cannot proceed any further after this error. Could you please advise how I should resolve this issue?

Many Thanks!

Welcome to the community, Harry! That 42P01 typically means your Boards schema on MySQL uses the older focalboard_workspaces table (not focalboard_teams), so please check which table exists on MySQL and either upgrade Boards/run its DB migrations first or change the AFTER LOAD line in boards.load to match your table name, then retry pgloader.