Created
November 22, 2019 19:04
-
-
Save caleb15/9f27336a637aaf32e8fd27c04d2c80bc to your computer and use it in GitHub Desktop.
how to migrate docker metabase h2 to postgres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export MB_DB_TYPE=postgres | |
export MB_DB_PORT=5432 | |
export MB_DB_USER=postgres | |
export MB_DB_PASS= | |
export MB_DB_HOST=db.metabase.staging | |
sudo docker cp metabase:/app/metabase.jar . | |
sudo docker stop metabase | |
java -jar metabase.jar load-from-h2 /home/metabase/metabase-data/metabase.db/metabase.db | |
# https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
metabase migration guide recommends stopping metabase before migrating but if you stop metabase while inside the docker container the container crashes (the container has to have it's main process running to work). So instead I copied the jar file out of the container and ran the migration outside.
This assumes that docker container has the h2 file mounted to
/home/metabase/metabase-data/metabase.db/metabase.db