[Solved] Migration from mysql to postgresql failure--migration mismatch

I am stuck. I’ve been following the guide, but I run

“postgres://mmuser:mypassword@localhost:5432/mattermost” --run-migrations --migrations-dir migrationsdir --check-schema-owner=false

I get the error “An Error Occurred: could not run migrations: could not apply migrations: migration mismatch, there are more migrations applied than those were specified in source”

I’ve tried feeding the mysql.output in directly by adding

–applied-migrations mysql.output

…but to no avail. Any thought, anyone? This migration as been awful. Up until now, mattermost has been smooth as silk.

Best,

Chris

Okay–I figured it out. The migrate.log file indicated that there were problems migrating the mysql into the new postgres mattermost database because of existing entries in the mattermost tables (usually conflicting/existing keys). I had to empty all the tables in the new mattermost postgress with a command like “truncate table name1, name2, …,lastname cascade; Here all the names are the table names that you can see by looking at the mattermost database while logged in as mmuser with a command like psql -h localhost -d mattermost -U mmuser. Everything worked and I’m logged in now to my newly migrated mattermost.

Thanks for sharing the resolution, Chris! Glad you’re up and running! :raising_hands:t2: