Metabase via Docker: Upgrade from 0.31.2 to latest 0.34

Hi & Greetings from Germany.
Using metabase version 0.31.2 with docker and an external located H2 database.
Is it possible to upgrade directly to the latest metabase version or do I have to do one update after another?

I’m asking because after the update metabase starts with the setup-dialog.
What I did?

  1. Did a copy of my database
    sudo cp /var/metabasedb/metabase.db.mv.db /var/metabasedb/metabase_bkup.db

  2. stopped the docker container
    sudo docker stop metabase

  3. removed the docker container and image
    sudo docker rm [Container ID]
    sudo docker rmi [Image ID]

  4. Load an run the new metabase docker image
    sudo docker run -d -p 3000:3000 –v /var/metabasedb:/var/metabasedb –e “MB_DB_FILE=/var/metabasedb/metabase.db” --name metabase metabase/metabase

After this I started the webbrowser: metabse starts with the setup-dialog…

Any idea what I did wrong?

Thanks & regards

Hi @Wombel
Yes, you can migrate directly from 0.31.2 to 0.34.0

Can you use ticks ` around commands, since the forum might be converting quotes and dashes, which makes it difficult to figure out if you did it be accident or the forum did it.

sudo docker run -d -p 3000:3000 -v /var/metabasedb:/var/metabasedb -e "MB_DB_FILE=/var/metabasedb/metabase.db" --name metabase metabase/metabase

Also, check the log on startup, since it might give a warning/error, which should hint at the problem.

I would highly recommend that you migrate away from H2:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
Just don’t migrate and upgrade at the same time - do it in two different steps.

i think probably it might be throwing an error of not being able to create a folder for the specified path

i have faced an issue like this before
so u can try did this

–e "MB_DB_FILE=/metabase.db"

Hi @flamber,

I think I’ve found the reason, but at the moment I don’t understand the context.
My metabase instance is running as a docker container. The H2 databse is mapped outside the container using the Paramter

-e “MB_DB_FILE=/var/metabasedb/metabase.db”

This means, that metabase should use the H2-Database-File metabase.db.mv.db located in the folder /var/metabasedb. If I check the existance of this fie in the filesystem, I find this:

So everything seems to be right.
But as you notice, there is a subfolder metabase.db. In this subfolder is also a H2-Database-File, and looking at the timestamp, I found out, that metabase is using this databasefile!
db

But why?
I checked my metabase instance using docker inspect
db

So metabase should use the databasefile stored in /var/metabasedb, but instead it uses the databasefile stored in /var/metabasedb/metabase.db.

Could anyone explain, what I misunderstood, or whats wrong here?

@Wombel
So what you’re seeing is a protection for accidental overwriting/owning too much.
I don’t know if you can understand scripts, but the logic is handled on these lines:
https://github.com/metabase/metabase/blob/master/bin/docker/run_metabase.sh#L50-L110
But again, H2 should never be used in production, so the script is just making sure it works, but there might be some issues with how it’s handled.

Thanks for your reply. Took me a while to understand the script syntax.
I moved my database file to the correct folder and the update runs fine, so my problem is solved.
Next I will try to migrate the database to MySQL.
Thanks for your support.
Regards
Axel