Migrate from metabase h2 to postgres

We have metabase deployed using docker-compose as seen below.

metabase_athena:
image: metabase/athena:latest
restart: always
logging:
driver: "json-file"
options:
max-size: "170m"
max-file: "5"
expose:
- "4000"
ports:
- 4000:3000
volumes:
- './metabase_4000_data:/metabase.db'

This is by default using h2 db.
We want to migrate it to postgres db which is deployed in a docker.

Hi @Sahil
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:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

And then start a new container by referencing the new application database:
https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html#using-postgres-as-the-metabase-application-database