We are using Mattermost v9.7.2 with mysql 8 on Ubuntu 20.04LTS—I’ve read your docs about moving away from mysql so I created an exact sandbox version of our production server (runs as a KVM VM) and following your instructions on " Automated PostgreSQL migration" using your “migration-assist” tool (migration-assist-v0.1). In this fully functional sandbox environment, I installed postgresql v15.8 ( I tried some other versions also–which had the same problem) and created a postgresql database per your instructions. I am able to connect to it.
The first stage of the “migration-assist” tool went fine. It connected to the mysql db and found and was able to fix one issue using the “–fix-artifacts” toggle–was clean after that.
The place I’m stuck on is " Step 2 - Create the PostgreSQL database schema" here is the string used and the resulting error:
root@mattermost:/home# ./migration-assist postgres “postgres://mmuser:secretpassword@localhost:5432/mattermost” --run-migrations --mattermost-version=“9.7.2”
2024-08-12 19:54:18 pinging postgres…
2024-08-12 19:54:18 connected to postgres successfully.
An Error Occurred: could not check schema owner: the user “mmuser” is not owner of the “public” schema
I have read and read and read everyting I could find and tried many things but I cannot get past this error. It’s connecting to the postgresql db with this user, but something in the migration tool is requiring the mmuser to be the owner of the Public schema—but the postgres user is the owner, of course. The following is the set of commands I’ve used to create the postgresql db, user and permissions----they don’t appear to satisfy the needs of the migration tool in this case:
sudo -u postgres psql
CREATE DATABASE mattermost;
CREATE USER mmuser WITH PASSWORD ‘secretpassword’;
GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
ALTER DATABASE mattermost OWNER TO mmuser;
GRANT USAGE, CREATE ON SCHEMA PUBLIC TO mmuser;
GRANT ALL ON SCHEMA public to mmuser;
\q
I don’t know what else to do to get the MM postgresql schema to install. As I mentioned, it’s in a KVM VM so it’s easy to try many, many things which blow it up—then I roll back using a clean snapshot. I’m not very comfortable trying the manual conversion method. I’ve read it through—and I hope that’s not my only way forward. Thanks for any help!