We have metabase deployed using docker-compose as seen below.
This is by default using h2 db.
We want to migrate it to postgres db which is deployed in a docker.
Just extract the H2 database and do the migration outside of Docker - it's a lot simpler and just a one-off process.
In case you didn't use a volume, then you would copy the H2 out of the container:
docker cp metabase:/metabase.db/metabase.db.mv.db ./
Then migrate away from H2 with the JAR instead of Docker:
And then start a new container by referencing the new application database: