Updating Metabase - Docker

Hi,

I’m running Metabase via container and I want to upgrade its version from 0.31.2 to 0.32.4.

I saw this topic Updating Metabase via Docker and followed the instructions.

But when I had finished the process, Metabase doesn’t recognize my data, like it was incompatible with the new version, can you guys help me with this?

Obs: I’m using H2 to storage data.

Hi @icaro

Always make backups - then you can revert if something fails.
Is the H2 file mounted on a volume outside of the container? If not, then it’s still located inside the 0.31.2-container and will be lost if you remove that container.
Meaning are you using the -e "MB_DB_FILE=..." as parameters to a volume on the host? The topic you linked to does not use the correct quotes - it should be " instead of “”
Note: 0.32.5 is now the newest version - released yesterday.

Here’s several of the other parameters available:
https://metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html

I would recommend that you don’t use H2, but you can look into that after you’re up and running:
https://metabase.com/docs/latest/operations-guide/start.html#migrating-from-using-the-h2-database-to-mysql-or-postgres

Hi @flamber,

I'm doing backups, my data is safe.

Yes, I used -v from Docker.

The following command is what I am using to create a container with the new version of Metabase:

docker run -d -p 3000:3000
-v /tmp:/metabase-data -e "MB_DB_FILE=/tmp/metabase.db"
--name metabase metabase/metabase:latest

Note: I used / tmp because the previous version of the metabase kept the data in this path.

But something is wrong with that command - it almost looks reversed.
You’re telling the container to link /metabase-data to the hosts /tmp. That’s a bad idea.
And then you’re telling Metabase to find the data file in /tmp of the container, which is empty and not connected to anything.

On you’re host, if you create a directory under your user called metabase-data, so the full path would be (example) /home/icaro/metabase-data, then you could use this command:

docker run -d -p 3000:3000 -v ~/metabase-data:/metabase-data -e "MB_DB_FILE=/metabase-data/metabase.db" --name metabase metabase/metabase

Look a few more times at the documentation - the examples are pretty good.

1 Like