How to migrate from H2 to MySql on Docker Desktop Windows

Hey All,
I am wanting to migrate from H2 to MySql. I am running metabase on Docker Desktop for windows.
I am a little lost when trying to follow the docs on how to do a migration because it seems to be for docker, not docker desktop.

Does anyone know how to do it using docker desktop?

If I need to run commands, how do I even access a command line for a container on Docker Desktop?
I guess because it's a GUI application, I am used to being babied and just pressing RUN. lol.

Hi @shane8johnson
Welcome to Metabase Discuss!

You can access Docker CLI when using Docker Desktop too.

Assuming you have installed it correctly and Docker added to your environment,
Open your command prompt and type docker
You will see information about your docker installation.

Following the docs here: Migrating to a production application database

I would add that you need to make sure you have Java installed and enabled on your computer.

The command:

docker run -d -p 3000:3000 \
  -e "MB_DB_TYPE=postgres" \
  -e "MB_DB_DBNAME=<your-postgres-db-name>" \
  -e "MB_DB_PORT=5432" \
  -e "MB_DB_USER=<db-username>" \
  -e "MB_DB_PASS=<db-password>" \
  -e "MB_DB_HOST=<your-database-host>" \
  --name metabase metabase/metabase

Can also be run in GUI. The values -e are environment variables that you can set in your Docker container before running it.

I hope these help.

1 Like