Update My SQL a Postgre

The step by step I successfully used (most of this is in the docs: Automated PostgreSQL migration - Mattermost documentation )

Preparations
cd /tmp/
wget https://github.com/mattermost/migration-assist/releases/download/v0.5/migration-assist-Linux-x86_64.tar.gz
tar -xvf migration-assist-Linux-x86_64.tar.gz
dnf install pgloader
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf install postgresql14-server.x86_64 postgresql14.x86_64 postgresql14-contrib.x86_64 --nobest
/usr/pgsql-14/bin/postgresql-14-setup initdb
systemctl start postgresql-14
systemctl enable postgresql-14

systemctl stop mattermost

Start the migration

./migration-assist mysql “mmuser:XXX@tcp(localhost:3306)/mattermost” --fix-artifacts --fix-unicode --fix-varchar

in the guide there is a single command you are supposed to run, but after finfing this info on some forums I did all these commands separately and it solved my issues
[root@mattermost:/tmp]# sudo -u postgres psql
psql (14.19)
Type “help” for help.

postgres=# create database mattermost;
CREATE DATABASE
postgres=# CREATE USER mmuser WITH PASSWORD ‘XXX’;
CREATE ROLE
postgres=# GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
GRANT
postgres=# ALTER DATABASE mattermost OWNER TO mmuser;
ALTER DATABASE
postgres=# GRANT USAGE, CREATE ON SCHEMA PUBLIC TO mmuser;
GRANT
postgres=# \c mattermost;
You are now connected to database “mattermost” as user “postgres”.
mattermost=# SELECT current_database();
current_database

mattermost
(1 row)

mattermost=# ALTER SCHEMA public OWNER to mmuser;
ALTER SCHEMA
mattermost=# GRANT ALL ON SCHEMA public to mmuser;
GRANT
mattermost=# \q

the command below should have your own mattermost version of course
./migration-assist postgres “postgres://mmuser:XXX@localhost:5432/mattermost?sslmode=disable” --run-migrations --mattermost-version=“10.8.0”
./migration-assist pgloader --mysql=“mmuser:XXX@tcp(localhost:3306)/mattermost” --postgres=“postgres://mmuser:XXX@localhost:5432/mattermost?sslmode=disable” --remove-null-chars > migration.load

pgloader migration.load > migration.log

./migration-assist postgres post-migrate --create-indexes “postgres://mmuser:XXX@localhost:5432/mattermost?sslmode=disable”
./migration-assist pgloader boards --mysql=“mmuser:XXX@tcp(localhost:3306)/mattermost” --postgres=“postgres://mmuser:XXX@localhost:5432/mattermost?sslmode=disable” > boards.load
./migration-assist pgloader playbooks --mysql=“mmuser:XXX@tcp(localhost:3306)/mattermost” --postgres=“postgres://mmuser:XXX@localhost:5432/mattermost?sslmode=disable” > playbooks.load
./migration-assist pgloader calls --mysql=“mmuser:XXX@tcp(localhost:3306)/mattermost” --postgres=“postgres://mmuser:XXX@localhost:5432/mattermost?sslmode=disable” > calls.load

pgloader boards.load > boards_migration.log
pgloader playbooks.load > playbooks_migration.log
pgloader calls.load > calls_migration.log

set the sql connector to PSQL and change the unit-file to point to PostgreSQL as in the guide
vi /opt/mattermost/config/config.json
vi /etc/systemd/system/mattermost.service

Start and check for errors
systemctl start mattermost
journalctl -xeu mattermost.service

Then update as in docs ( Upgrade Mattermost Server - Mattermost documentation )
wget https://releases.mattermost.com/11.1.0/mattermost-11.1.0-linux-amd64.tar.gz
tar -xvf mattermost-11.1.0-linux-amd64.tar.gz mattermost/
systemctl stop mattermost
cd /opt/
cp -ra mattermost/ mattermost-back-$(date +‘%F-%H-%M’)/
sudo find mattermost/ mattermost/client/ -mindepth 1 -maxdepth 1 ! ( -type d ( -path mattermost/client -o -path mattermost/client/plugins -o -path mattermost/config -o -path mattermost/logs -o -path mattermost/plugins -o -path mattermost/data ) -prune ) | sort | sudo xargs rm -r

cp -an /tmp/mattermost/. mattermost/
chown -R mattermost:mattermost mattermost
setcap cap_net_bind_service=+ep ./mattermost/bin/mattermost

systemctl start mattermost
journalctl -xeu mattermost.service

Finally the forumposts I used at some point soving this issue for me
search path error

config that was depricated
https://support.mattermost.com/hc/en-us/articles/42915463550996-Mattermost-11-x-Upgrade-Error-Hidden-Archived-Channels