Upgrade from 0.36.6 to 0.37.x

Hi friends!

I’m running metabase 36.6 on docker with a “custom container” as it is described here:

https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html > under the heading “Getting your config back if you stopped your container”.

I connected a mysql database to this container and configured a lot of questions, dashboards.

If I’m understand it correctly the current application database is mysql, metabase made an own table in my mysql database.

If im correct: In order to upgrade to 37.3 I need application database config from the container and load it to an shared volume for 37.3. However I can not find it.

This command, leads to an empty metabase.db folder.

docker cp CONTAINER_ID:/metabase.db ./

I also search the active container via the bash and couldn’t find any databases.

Hi @megrano
Please post “Diagnostic Info” from Admin > Troubleshooting.
If you have configured MySQL as the application database, then all your Metabase data is stored there, and there will not be a H2 file in the container.

Hello @flamber

here it is:

{
  "browser-info": {
    "language": "de",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0",
    "vendor": ""
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.8+10",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.8",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.8+10",
    "os.name": "Linux",
    "os.version": "4.15.0-99-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "mysql"
    ],
    "hosting-env": "unknown",
    "application-database": "mysql",
    "application-database-details": {
      "database": {
        "name": "MySQL",
        "version": "5.7.30"
      },
      "jdbc-driver": {
        "name": "MariaDB Connector/J",
        "version": "2.6.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2020-09-15",
      "tag": "v0.36.6",
      "branch": "release-0.36.x",
      "hash": "cb258fb"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

I guess this means that the application database is mysql. But how do I upgrade to latetst? How do I tell the new metabase-lastest container to load from my mysql database?

@megrano You would remove your current container, update the image, and start a new container with the same environment variables as your current container.
https://www.metabase.com/docs/latest/operations-guide/upgrading-metabase.html
https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html

I did exactly this. But the new container started up with the empty h2 database. He didn’t recognize the mysql database as application database.

@megrano Post your docker run command (redact sensitive info)

Im running on docker-compose… can switch to docker run is necessary:

docker-compose.yml:

version: "3"

services:
  metabase:
    network_mode: host
    container_name: "metabase-lastest"
    restart: "unless-stopped"
    image: metabase/metabase
    env_file:
      - ./config/metabase_database.env

with the evn_file: metabase_database.env

ENV MB_DB_TYPE=mysql
ENV MB_DB_DBNAME=metabase
ENV MB_DB_PORT=3306
ENV MB_DB_USER=root
ENV MB_DB_PASS=XXXXXXXX
ENV MB_DB_HOST=localhost

ENV MB_ENCRYPTION_SECRET_KEY=XXXXXXXXXXX

@megrano Post the commands that you do to remove, update, and create new instance.

It’s simply docker-compose down, then I edit the docker-compose.yml file to the one I posted above. (I modify container_name and image).

After that docker-compose up.

Very simple.)

@megrano You should not use ENV in front of your variables: https://docs.docker.com/compose/env-file/

Holy cow! Thank you so much!

It's works! Im running Metabase 0.37.3 which

is the latest and greatest!