Upgrade from 9.4.5 to 9.5.x or 9. 7.3

Hi,
I tried to Update mattermost with Docker. But I got this message:

First I tried 9.4.5 to 9.5.0.
But I got this message:

idx_poststats_userid ON poststats(userid)
mattermost | Error: failed to initialize platform: cannot cre ate store: failed to apply database migrations: driver: postgres, message: faile d to execute migration, command: executing_query, originalError: pq: relation “p oststats” does not exist, query:
mattermost |
mattermost | – morph:nontransactional
mattermost | CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_post stats_userid ON poststats(userid)
mattermost |
mattermost | Usage:
mattermost | mattermost [flags]
mattermost | mattermost [command]
mattermost |
mattermost | Available Commands:
mattermost | completion Generate the autocompletion script for the specified shell
mattermost | db Commands related to the database
mattermost | export Export data from Mattermost
mattermost | help Help about any command
mattermost | import Import data.
mattermost | jobserver Start the Mattermost job server
mattermost | server Run the Mattermost server
mattermost | version Display version information
mattermost |
mattermost | Flags:
mattermost | -c, --config string Configuration file to us e.
mattermost | -h, --help help for mattermost
mattermost |
mattermost | Use “mattermost [command] --help” for more infor mation about a command.
mattermost |
mattermost exited with code 1

How can I upgrade or fix this upgrade?

does anybody have an idea?

It looks like your previous migrations didn’t work.

Could you run this: select * from db_migrations order by version desc limit 10; and post the output?

Also, please use the latest dot release of 9.5 instead of 9.5.0.

Hi,

first: Thanks a lot for your support!!!
Here is the output:

select * from db_migrations order by version desc limit 10;
version | name
---------±-------------------------------------------------
117 | msteams_shared_channels
116 | create_outgoing_oauth_connections
115 | user_reporting_changes
114 | sharedchannelremotes_drop_nextsyncat_description
113 | create_retentionidsfordeletion_table
112 | rework_desktop_tokens
111 | update_vacuuming
109 | create_persistent_notifications
108 | remove_orphaned_oauth_preferences
107 | threadmemberships_cleanup
(10 rows)

When I upgrad to 9.5.5 I have the same problem

Ok, that’s a bit strange. Because it shows the migration 115 as complete but that didn’t happen.

Anyways, you can run this:

CREATE MATERIALIZED VIEW IF NOT EXISTS poststats AS
SELECT userid, to_timestamp(createat/1000)::date as day, COUNT(*) as numposts, MAX(CreateAt) as lastpostdate
FROM posts 
GROUP BY userid, day;

on the DB, and then re-attempt the upgrade to 9.5.5.

This helped! Thank you so much!!!

What is currently recommended? Should I upgrade to 9.7 or still 9.5? What do you think?

You can upgrade to 9.7.