I hit a problem with my mattermost upgrade that is not listed in the migration-assist errors. I had to build my own pgloader due to mysql server having sha2 authentication but after I figured that out and the heap error issues it finally finished the migration. Though there are several warnings about columns. Once I hit Step 5 - Restore full-text indexes & create all indexes I get the following error output which doesnt make sense
@SERVER/mattermost"
2025-11-15 21:07:14 could not find the default schema âpublicâ in search_path, consider setting it from the postgresql console
2025-11-15 21:07:14 search_path is set to âpublicâ for the currrent session
2025-11-15 21:07:14 running migrations..
2025-11-15 21:07:14 applying create_idx_fileinfo_content_txt.sql
2025-11-15 21:07:16 Index creation failed due to content being too long for tsvector.
This is expected if you have a large amount of data.
Please run the migration manually and refer to the documentation page below:
migration log warnings
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelBookmarksâ.âdisplaynameâ is casted to type âvarcharâ which is not the same as âtextâ, >
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelBookmarksâ.âsortorderâ is casted to type âbigintâ which is not the same as âintegerâ, >
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelBookmarksâ.âlinkurlâ is casted to type âvarcharâ which is not the same as âtextâ, the >
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelBookmarksâ.âimageurlâ is casted to type âvarcharâ which is not the same as âtextâ, the>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelBookmarksâ.âtypeâ is casted to type âchannel_bookmark_typeâ which is not the same as ">
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelMembersâ.âschemeuserâ is casted to type âsmallintâ which is not the same as âbooleanâ,>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelMembersâ.âschemeadminâ is casted to type âsmallintâ which is not the same as âbooleanâ>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelMembersâ.âschemeguestâ is casted to type âsmallintâ which is not the same as âbooleanâ>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âChannelsâ.âtypeâ is casted to type âchannel_typeâ which is not the same as "mattermost.channe>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âOutgoingOAuthConnectionsâ.âoauthtokenurlâ is casted to type âvarcharâ which is not the same a>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âOutgoingOAuthConnectionsâ.âgranttypeâ is casted to type âvarcharâ which is not the same as "m>
2025-11-15T21:03:58.025011Z WARNING Source column âmattermostâ.âPreferencesâ.âvalueâ is casted to type âvarcharâ which is not the same as âtextâ, the type of>
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âRetentionIdsForDeletionâ.âidsâ is casted to type âjsonbâ which is not the same as "character >
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âScheduledPostsâ.âpriorityâ is casted to type âvarcharâ which is not the same as âtextâ, the t>
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âTeamMembersâ.âschemeuserâ is casted to type âsmallintâ which is not the same as âbooleanâ, th>
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âTeamMembersâ.âschemeadminâ is casted to type âsmallintâ which is not the same as âbooleanâ, t>
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âTeamMembersâ.âschemeguestâ is casted to type âsmallintâ which is not the same as âbooleanâ, t>
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âTeamsâ.âtypeâ is casted to type âteam_typeâ which is not the same as âmattermost.team_typeâ, >
2025-11-15T21:03:58.026011Z WARNING Source column âmattermostâ.âUploadSessionsâ.âtypeâ is casted to type âupload_session_typeâ which is not the same as "matt>
2025-11-15T21:03:58.034012Z WARNING PostgreSQL warning: constraint âfk_retentionpolicieschannels_retentionpoliciesâ of relation âretentionpolicieschannelsâ d>
2025-11-15T21:03:58.034012Z WARNING PostgreSQL warning: constraint âfk_retentionpoliciesteams_retentionpoliciesâ of relation âretentionpoliciesteamsâ does no>
2025-11-15T21:04:34.559417Z LOG report summary reset
migration.load:
WITH data only,
prefetch rows = 500,
workers = 8, concurrency = 1,
multiple readers per thread, rows per range = 10000,
prefetch rows = 10000, batch rows = 2500,
create no tables, create no indexes,
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 Channels.Type to âchannel_typeâ drop typemod,
column Teams.Type to âteam_typeâ drop typemod,
column UploadSessions.Type to âupload_session_typeâ drop typemod,
column ChannelBookmarks.Type to âchannel_bookmark_typeâ drop typemod,
column Drafts.Priority to text,
type int when (= precision 11) to integer drop typemod,
type bigint when (= precision 20) to bigint drop typemod,
type text to varchar drop typemod using remove-null-characters,
type tinyint when (<= precision 4) to boolean using tinyint-to-boolean,
type json to jsonb drop typemod using remove-null-characters
EXCLUDING TABLE NAMES MATCHING ~<IR_>, ~, ~, âschema_migrationsâ, âdb_migrationsâ, âdb_lockâ,
âconfigurationsâ, âconfigurationfilesâ, âdb_config_migrationsâ
BEFORE LOAD DO
$$ ALTER SCHEMA public RENAME TO mattermost; $$,
$$ TRUNCATE TABLE mattermost.systems; $$,
$$ DROP INDEX IF EXISTS mattermost.idx_posts_message_txt; $$,
$$ DROP INDEX IF EXISTS mattermost.idx_fileinfo_content_txt; $$
AFTER LOAD DO
$$ UPDATE mattermost.db_migrations set name=âadd_createat_to_teamembersâ where version=92; $$,
$$ ALTER SCHEMA mattermost RENAME TO public; $$,
$$ SELECT pg_catalog.set_config(âsearch_pathâ, ââ$userâ, â$userâ, publicâ, false); $$,
$$ ALTER USER mmuser SET SEARCH_PATH TO ââ$userâ, publicâ; $$;
I also encountered an issue with database ownership that was not covered in the target database setup section
I did not apply the following step due to my postgres being v14 unless im mistaken.
-
If using PostgreSQL v15.x or later, additional grants are required:
ALTER DATABASE mattermost OWNER TO mmuser; ALTER SCHEMA public OWNER TO mmuser; GRANT USAGE, CREATE ON SCHEMA public TO mmuser;
which is weird since even if I would apply this step it would still error out.
I did have to apply the mmuser to own the mattermost server rather than the postgres user which allowed the migration to continue.
Any help would be great.