Skip to content
Snippets Groups Projects
Commit 425cac45 authored by Sameer Al-Sakran's avatar Sameer Al-Sakran Committed by GitHub
Browse files

Merge pull request #5476 from joshuashort/docker-h2-migration-instructions

Docker H2 to Postgres migration documentation
parents a73af3c0 d9ec552e
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,35 @@ In this scenario all you need to do is make sure you launch Metabase with the co
Keep in mind that Metabase will be connecting from within your docker container, so make sure that either you're using a fully qualified hostname or that you've set a proper entry in your container's `/etc/hosts file`.
See instructions for [migrating from H2 to MySQL or Postgres](./start.md#migrating-from-using-the-h2-database-to-mysql-or-postgres).
### Migrating from H2 to Postgres as the Metabase application database
For general information, see instructions for [migrating from H2 to MySQL or Postgres](./start.md#migrating-from-using-the-h2-database-to-mysql-or-postgres).
To migrate an existing Metabase container from an H2 application database to another database container (e.g. Postgres, MySQL), there are a few considerations to keep in mind:
* The target database container must be accessible (i.e. on an available network)
* The target database container must be supported (e.g. MySQL, Postgres)
* The existing H2 database should be [mapped outside the running container](#mounting-a-mapped-file-storage-volume)
The migration process involves 2 main steps:
1. Stop the existing Metabase container
2. Run a new, temporary Metabase container to perform the migration
Using a Postgres container as the target, here's an example invocation:
docker run --name metabase-migration \
-v /path/metabase/data:/metabase-data \
-e "MB_DB_FILE=/metabase-data/metabase.db" \
-e "MB_DB_TYPE=postgres" \
-e "MB_DB_DBNAME=metabase" \
-e "MB_DB_PORT=5432" \
-e "MB_DB_USER=<username>" \
-e "MB_DB_PASS=<password>" \
-e "MB_DB_HOST=my-database-host" \
metabase/metabase load-from-h2
To further explain the example: in addition to specifying the target database connection details, set the `MB_DB_FILE` environment variable for the source H2 database location, and pass the argument `load-from-h2` to begin migrating.
### Setting the Java Timezone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment