Hello, I attempted to upgrade my 5.3.1 instance in this guide:
https://docs.mattermost.com/upgrade/upgrading-mattermost-server.html
To mattermost version 7.10. I erroneously thought the version we were hosting was 5.35.5 and decided to make the massive jump. I was wrong and it was 5.3.1.
After attempting the upgrade the mattermost service will not start and I get an error that the database migration failed and the sql error said it was that the mattermost user didnt have access (It does, and i was able to sign into mysql and change values in db manually).
I then attempted to upgrade the version to 5.35.5, that also did not work.
I just rolled back to 5.3.1 and it works fine again.
This was the error I got on the 7.10 upgrade
root@ubuntu-s-1vcpu-2gb-nyc3-01-mm:/opt/mattermost# sudo -u mattermost ./bin/mattermost
{"timestamp":"2023-07-08 19:57:50.564 Z","level":"info","msg":"Server is initializing...","caller":"platform/service.go:165","go_version":"go1.19.5"}
{"timestamp":"2023-07-08 19:57:50.564 Z","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:242","database":"master","dataSource":"****:****@tcp(127.0.0.1:3306)/mattermost?writeTimeout=30s&charset=utf8mb4%2Cutf8"}
{"timestamp":"2023-07-08 19:57:50.615 Z","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:242","database":"master","dataSource":"****:****@tcp(127.0.0.1:3306)/mattermost?multiStatements=true&writeTimeout=30s&charset=utf8mb4%2Cutf8"}
{"timestamp":"2023-07-08 19:57:50.631 Z","level":"fatal","msg":"Failed to apply database migrations.","caller":"sqlstore/store.go:170","error":"driver: mysql, message: failed when applying migration, command: apply_migration, originalError: Error 1044 (42000): Access denied for user 'mmapp'@'%' to database 'mattermost', query: \n\nCREATE TABLE IF NOT EXISTS Commands (\n Id varchar(26) NOT NULL,\n Token varchar(26) DEFAULT NULL,\n CreateAt bigint(20) DEFAULT NULL,\n UpdateAt bigint(20) DEFAULT NULL,\n DeleteAt bigint(20) DEFAULT NULL,\n CreatorId varchar(26) DEFAULT NULL,\n TeamId varchar(26) DEFAULT NULL,\n `Trigger` varchar(128) DEFAULT NULL,\n Method varchar(1) DEFAULT NULL,\n Username varchar(64) DEFAULT NULL,\n IconURL text,\n AutoComplete tinyint(1) DEFAULT NULL,\n AutoCompleteDesc text,\n AutoCompleteHint text,\n DisplayName varchar(64) DEFAULT NULL,\n Description varchar(128) DEFAULT NULL,\n URL text,\n PRIMARY KEY (Id),\n KEY idx_command_team_id (TeamId),\n KEY idx_command_update_at (UpdateAt),\n KEY idx_command_create_at (CreateAt),\n KEY idx_command_delete_at (DeleteAt)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\nSET @preparedStatement = (SELECT IF(\n (\n SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS\n WHERE table_name = 'Commands'\n AND table_schema = DATABASE()\n AND column_name = 'PluginId'\n ) > 0,\n 'SELECT 1',\n 'ALTER TABLE Commands ADD PluginId varchar(190);'\n));\n\nPREPARE alterIfNotExists FROM @preparedStatement;\nEXECUTE alterIfNotExists;\nDEALLOCATE PREPARE alterIfNotExists;\n\nCREATE PROCEDURE Migrate_If_Version_Below_5280 ()\nBEGIN\nDECLARE\n\tCURRENT_DB_VERSION TEXT;\nDECLARE\n SYSTEMS_TABLE_EXISTS INT;\n SELECT COUNT(*)\n FROM INFORMATION_SCHEMA.COLUMNS\n WHERE\n TABLE_NAME = 'Systems'\n AND table_schema = DATABASE() INTO SYSTEMS_TABLE_EXISTS;\n IF (SYSTEMS_TABLE_EXISTS > 0) THEN\n\t SELECT\n\t\t Value\n\t FROM\n\t\t Systems\n\t WHERE\n\t\t Name = 'Version' INTO CURRENT_DB_VERSION;\n\t IF(INET_ATON(CURRENT_DB_VERSION) < INET_ATON('5.28.0')) THEN\n\t\t UPDATE Commands SET PluginId = '' WHERE PluginId IS NULL;\n\t END IF;\n END IF;\nEND;\n\tCALL Migrate_If_Version_Below_5280 ();\n\tDROP PROCEDURE IF EXISTS Migrate_If_Version_Below_5280;\n\n"}
and here is the error i got for the 5.35.5
Error: failed to load configuration: failed to create store: unable to load on store creation: invalid config: Config.IsValid: model.config.is_valid.collapsed_threads.app_error,
At this point I dont know what to do. Is there anything precursor steps? I read the prepare guide but I didnt see anything at the time to do for me and my instance. Unless im just being dense this late saturday afternoon.
I really appreciate anyones response into this matter.
Been happily using MM for years though