[SOLVED] Upgrade 3.4 to 3.6 using Docker

Hi,

Is there a guide how to upgrade a Docker instance (using Team edition)? I see changes in the database, so I assume that some data conversion or script needs to be executed in order to change the database?

Or are your docker containers that awesome that automatically do these updates? :smiley:

I noticed that the DB docker definition only creates the database, so this leads me to believe that the app docker takes care of creating/updating the schema?

Thanks

Hi @ngcnelson,

It should be update automatically when you start the 3.6 container, it may take a couple of minutes depending on how big your database is, but as I said it should be pretty straight forward.

Either way I would recommend following the Backup documentation just in case.

Happy upgrading!!

Hi @elias

Thanks for that info. Iā€™ll do a dry run tonight or tomorrow while people are offline.

And yes, Iā€™ll make a backup before hand.

Thanks!

Hi @ngcnelson, did it work as expected?

Hi @elias
Yes, I did a dry run first and then did the upgrade over the weekend. It worked without a hitch. Thanks!

1 Like

hi elias

do you mean that we can install the latest docker and then it will upgrade our existing 3.4 container?
i tried that and it didnā€™t work.
when we launched our existing container, it is still 3.4.
we donā€™t want to lose our contents.

we followed the instructions here
https://docs.mattermost.com/install/docker-local-machine.html#ubuntu

we got this error:
docker: Error response from daemon: Conflict. The container name ā€œ/mattermost-previewā€ is already in use by container 3c9a868d7433991cfa9f9b3d0a9dd6314c921759e8451026c80aa3aac7a02e28. You have to remove (or rename) that container to be able to reuse that nameā€¦
when running this
docker run --name mattermost-preview -d --publish 8065:8065 mattermost/mattermost-preview

thank you

Hi @functioneer
It seems like youā€™re running the preview version and without storing the data in a separate volume. So all the data is inside. If you remove it the container youā€™ll lose all of your data.
If this is indeed a preview and the data doesnā€™t matter then proceed here:
Thatā€™s Docker telling you that a container for that image already exists. Do this to remove the container, so that it creates the new container with the new image when you run the specified command (so run this first):

docker rm mattermost-preview

Now, if you have data, you need to rescue it from inside the container and save it somewhere else. Containers store their volume data inside /var folder (a really long folder name).
See here for more details about volumes
https://docs.docker.com/engine/tutorials/dockervolumes/

Thereā€™s an explanation of the command docker inspect <name of your container> which can tell you where your data is located. So my advice will be to use that, get the volume where the data is being saved, copy it to another folder, then run the preview image (create a separate container, with a different name) but this time mount the volume to that folder (where you copied the files earlier) and see if your data is there.
Let me know how it goes!