Upgrade question

I have a question about upgrading from one version to the next. The instructions here mention knowing the file storage location, but then they don’t say what to do with the data. I upgraded to 3.9, but even copying the data folder, I am unable to restore the user’s profile pictures. Any ideas would be appreciated.

I put the instruction about knowing the file storage location for when you back up the files in Step 7. In many cases the person doing the upgrade is not the person who originally installed Mattermost, or they don’t recall the location that they specified, if different from the default.

I don’t know why the profile pictures don’t show up. Can you verify that the pictures are actually on disk at the correct location? On a default install, with ./data/ as the file storage location, the pictures are in /opt/mattermost/data/users.

jeff@ubuntu64:/opt/mattermost$ sudo locate profile.png
/opt/mattermost/data/users/3d8dxosnrpnb88rkqh6nqcb7jo/profile.png
/opt/mattermost/data/users/43hqp7pext817bwui4uknfebza/profile.png
/opt/mattermost/data/users/66qppmw96jnx9p9i3oir18pqdw/profile.png
.
.
.


You might have to do sudo updatedb first to make sure the index used by the locate command is current.

The strings of random-looking chars are user IDs.

If the profile pics are in the right place, check file permissions on the user ID directories.

1 Like

I did copy over the ./data directory with all the profile.png files. However for some reason they are not being used. Is it possible that the user IDs changed during the upgrade?

Well I think I figured it out. Once I fixed the directory/file permissions and then flushed the desktop client cache and reloaded things are back to normal. Thanks for the help.

You’re welcome!

Any idea why the file permissions were not correct? Maybe I can update the docs to prevent others from having the same issue.

No idea actually.

I looked at the backup I had made like the docs suggested and matched those.

Directories:754
Profile.png:644

Actually I am still seeing some sort of funkyness.

For some reason I am still seeing a default image even after a user changes their profile picture. I have tried flushing caches etc, to no avail.

I got a bit further and it seems to be related to the compact view. So in Standard view the image shows up fine. But in compact view I see a default image. It seems that the compact view is using the following API:
https://www.example.com/api/v3/users/837kyk8yi38d3jpwx8zpthzhjg/image?time=undefined

With time=undefined the image returned is the default. Removing that gives the saved image:
https://www.example.com/api/v3/users/837kyk8yi38d3jpwx8zpthzhjg/image?

Could this be a bug?

It looks like it could be this bug: https://mattermost.atlassian.net/browse/PLT-6830

@attzonko To follow up on Jeff’s post the exact value of that ?time=X isn’t actually used by the server, so being undefined doesn’t hurt, however it should change to invalidate any caching. I assume what you’re seeing with the ?time=undefined is from a cache before you copied the data over. Without the time parameter, you’re now seeing the updated image because that route hadn’t been accessed before, so it wasn’t in the cache. I imagine if a user changes their profile picture, you won’t see the update even with without the time parameter.

We should be fixing the undefined time parameter for the next release, but in the mean time, you’ll have to wait for the cache on that to expire. It should only last a day

1 Like