After an upgrade from version 2.0.1 to 3.0.2 we lost the profile pictures of all team members.
We used 2.0.1 and upgraded to 3.0.2. My Mattermost installation includes a single team with 32 members. Mattermost is running in an VM on a server machine in our company. So i backuped the image and followed these steps: http://docs.mattermost.com/administration/upgrade.html
After I ran the command ./platform -upgrade_db_30 the database migrate successfully to the new version. Except the profile pictures. There were an error that told me that the script can't migrate the profile pictures.
Any idea why? Only profile pictures are affected so this is not really important.
Would you mind sharing the error logs? or the errors related to migration of profile pics?
Yes, but I removed the mail addresses, hope that's ok.
https://gist.github.com/MetalCar/89b7018b8f7772e02f871141570963de
Thanks @MetalCar, it appears your data dir was missing/empty and the upgrade process was just warning it couldn't find a profile image. May I ask how you setup Mattermost? did you follow one of our guides or docker images?
I followed one of your guides. But yes, my data directory was empty while migrating to the new database.....so I find another error that I have, that old pictures that someone uploaded in mattermost were lost......i copied my data directory from the previous version to the new one and also this error is done....I think, now it is clear what I've to do when the next update come....this was the first mattermost update that I made.
Just to confirm that you migrated to a new server and copied over the data dir after running the upgrade?
i copied to the same server, but renamed the existing directory which contains mattermost v2.1 and used the new directory (which contains mattermost v3.0) that i extracted from the tar file. then i forgot to copy back the data directory, because i doesn't know that this directory exists.
Same problem as MetalCar, didn't know that this folder would be erased while extracting the new tar file.
Hi,
If you maintain directories name for mattermost root like mattermost-x.x.x, you won't have this problem
Probably it will be better for mattermost tarball to have a root directory named with the version directly.
My contribution to this BR, is that the documentation in http://docs.mattermost.com/administration/upgrade.html#upgrading-to-team-edition-3-0-x-from-2-x SHOULD clearly point to backup the data directory, in 3) and restore it in 5).
Another detail is for the migration to 3.x you should point that data dir structure has changed, and that cp -r old new will not be sufficient.
the structure was before 3.0 : data/teams/$TEAMHASH/users/
and is now : data/{teams,users}
So you will have everything up again if you properly move user data like:
$ mkdir mattermost.new/data/users
$ mv mattermost.old/data/teams/*/users/* mattermost.new/data/users/
Hi,
yes, i moved the different directories manually. Seems that I did it right :smile:
But yes, please add the data directory to the upgrade documentation.
Thanks for the contributions on this thread. We鈥檝e updated the upgrade guide to add explicit instructions on backing up and restoring the data folder if using local file storage. These steps will ensure profile pictures are not lost in the upgrade to v3.0.
Most helpful comment
Hi,
If you maintain directories name for mattermost root like
mattermost-x.x.x, you won't have this problemProbably it will be better for mattermost tarball to have a root directory named with the version directly.
My contribution to this BR, is that the documentation in http://docs.mattermost.com/administration/upgrade.html#upgrading-to-team-edition-3-0-x-from-2-x SHOULD clearly point to backup the
datadirectory, in 3) and restore it in 5).Another detail is for the migration to
3.xyou should point that data dir structure has changed, and thatcp -r old newwill not be sufficient.the structure was before 3.0 :
data/teams/$TEAMHASH/users/and is now :
data/{teams,users}So you will have everything up again if you properly move user data like: