It's best to set your Java timezone to match the timezone you'd like all your reports to come in. 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. Using a Postgres container as the target, here's an example invocation: docker run -name metabase-migration \ Run a new, temporary Metabase container to perform the migration.The migration process involves 2 main steps: The existing H2 database should be mapped outside the running container.The target database container must be supported (e.g.The target database container must be accessible (i.e.Postgres, MySQL), there are a few considerations to keep in mind: To migrate an existing Metabase container from an H2 application database to another database container (e.g. Migrating from H2 to Postgres as the Metabase application databaseįor general information, see instructions for migrating from H2 to MySQL or Postgres. 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. For example: docker run -d -p 3000:3000 \ In this scenario all you need to do is make sure you launch Metabase with the correct environment variables containing your Postgres database connection details and you're all set. If you are ready to completely move off the H2 embedded database for running Metabase and prefer to use Postgres we've got that covered too. Using Postgres as the Metabase application database If it's not the one you expected try a different stopped container and do these steps again. Hopefully you have your previously configured Metabase Installation back. Run your new image using docker run to get up and running again.ĭocker run -d -p 3000:3000 -name metabase mycompany/metabase-customĤ30bb02a37bb2471176e54ca323d0940c4e0ee210c3ab04262cb6576fe4ded6d.docker commit ca072cd44a49 mycompany/metabase-custom Use docker commit to create a new custom docker image from the stopped container containing your configuration. Once you have identified the stopped container with your configuration in it, save the container ID from the left most column for the next step.Ģ. Find the stopped container using the docker ps -a command.Ĭa072cd44a49 metabase/metabase "/app/run_metabase.sh" About an hour ago Up About an hour 0.0.0.0:3000->3000/tcp metabaseĠ2e4dff057d2 262aa3d0f714 "/app/run_metabase.sh" 23 hours ago Exited (0) 23 hours ago pedantic_hypatiaĠd2170d4aa4a 262aa3d0f714 "/app/run_metabase.sh" 23 hours ago Exited (0) 23 hours ago stoic_lumiere.If you have previously run and configured your Metabase using the local Database and then stopped the container, your data will still be there unless you deleted the container with the docker rm command. Getting your config back if you stopped your container Now when you launch your container we are telling Metabase to use the database file at ~/metabase-data/metabase.db instead of its default location and we are mounting that folder from our local filesystem into the container. docker run -d -p 3000:3000 -v ~/metabase-data:/metabase-data -e "MB_DB_FILE=/metabase-data/metabase.db" -name metabase metabase/metabase To persist your data outside of the container and make it available for use between container launches we can mount a local file path inside our container. The end result is that your Metabase application data will be on disk inside your container and lost if you ever remove the container. In its default configuration Metabase uses the local filesystem to run an H2 embedded database to store its own application data. For example running Metabase on port 12345: docker run -d -p 12345:3000 -name metabase metabase/metabase Since Docker containers have their own ports and we just map them to the system ports as needed it's easy to move Metabase onto a different system port if you wish. Once the Metabase startup completes you can access the app at localhost:3000 You can use docker logs -f metabase to follow the rest of the initialization progress. This will launch a Metabase server on port 3000 by default. Here's a quick one-liner to get you off the ground (please note, we recommend further configuration for production deployments below): docker run -d -p 3000:3000 -name metabase metabase/metabase If you're trying to upgrade your Metabase version on Docker, check out these upgrading instructions. Metabase provides an official Docker image via Dockerhub that can be used for deployments on any system that is running Docker.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |