Metabase Migrate H2 To Postgresql

Metabase is fastest, easiest way to share data and analytics inside your company. Most importantly it’s open source. We’ve had our sales, support and marketing teams use it to pull out information about customers.

  1. Metabase Migrate H2 To Postgresql Free
  2. Metabase Migrate H2 To Postgresql Server

2 As the warning in the footer states quite clearly, you cannot migrate the H2 database. That's why there's a big red warning in the footer when you're using the embedded database. It's for initial evaluation purposes only. What Is Metabase? I would describe Metabase as a tool that can provide you a graphical interface to create business intelligence and analytics graphs in minutes. It does not require any previous SQL knowledge, and it has a nice interface where you can simply make analytics with just a few clicks.

Metabase Migrate H2 To Postgresql Free

Let’s get to it, then..

Metabase

First update your packages with the following command:

sudo aptitude update

Second install Mysql on your server with the following command:

sudo aptitude install mysql-server php5-mysql

This will install MySQL and other dependent packages.The installation will ask you to enter a new password for the user root of MySQL:

This completes your mysql installation. Login to you mysql console using the following command:

mysql -uroot -p<password_you_set_at_above_prompt>

Create a new database named metabase using the following command:

CREATE DATABASE metabase;

Starting data migration:

Set the following environment variables using the following commands:

export MB_DB_TYPE=mysql
export MB_DB_DBNAME=metabase
export MB_DB_PORT=3306
export MB_DB_USER=root
export MB_DB_PASS=<password_you_set_at_above_prompt>

Now switch to your Metabase installation directory and run the following command:

java -jar metabase.jar load-from-h2

It is very important to note that Metabase start-up logs show following 3 lines, this confirms that your metabase instance picked up the newly set mysql database and will store new data on it going forward.

08-03 12:08:33 INFO metabase.db :: Verifying mysql Database Connection …
08-03 12:08:34 INFO metabase.db :: Verify Database Connection … ?
08-03 12:08:34 INFO metabase.db :: Running Database Migrations…

It’s done. You’ve migrated you metabase installation to mysql. yay 🙂

In case you want to use postgresql in place of mysql, refer the following part instead of mysql one above.

Update your packages with :

sudo apt-get update

Install postgresql with the following command:

sudo aptitude install php5-common libapache2-mod-php5 php5-cli

Check your installation with the following command:

su – postgres

You’ll be logged in as a postgres user.

Set the following environment variables instead the ones used for mysql using the following commands:

export MB_DB_TYPE=postgres

export MB_DB_DBNAME=metabase

Migrate

export MB_DB_PORT=3306

export MB_DB_USER=root

export MB_DB_PASS=<password_you_set_at_above_prompt>

exportMB_DB_HOST=localhost

Follow steps from starting data migration section.

At Clever Cloud we manage most of our own data and when we want to gather a particular information, we open our SQL interpreter and query all the things manually. This somehow worked because most of us are technical but it's not necessary the case anymore. So we want a nice dashboarding solution to make data available in a nicer way. This is how we came upon Metabase.

What is Metabase? In their own words:

The fastest, easiest way to share data and analytics inside your company.

You can configure different questions/queries/visualisations and organize them in dashboard. Take a look at their documentation to grasp the full extend of what you can do.

How to deploy Metabase

Metabase is written in java and available as a jar you can download and requires a PostgreSQL database. In Clever Cloud terms it means you will need a Java runtime and a PostgreSQL addon. It's dead easy to setup. Here's what you need to do to deploy it:

Now you should see the logs showing up. Once it's over you can type clever open and it will take you straight to your Metabase instance. You should see a wizard to help you create your admin user and connect a first database. If you ave set the MB_ENCRYPTION_SECRET_KEY variable, don't wory the databases credentials you enter in the Metabase will be encrypted.

Now you have a lot of things to do. And there is a lot more you can configure as you will see in their admin guide: Enable Emailing, Slack integration, add new authentication connectors... With that you should be ready to setup and query most of the datasources available to you and produce awesome dahsboards. Happy hacking!

Metabase Migrate H2 To Postgresql Server

FREE SIGNUP
Feel the coding productivity of a brand new project again, at scale.

By clicking 'Get started' I agree to Clever Cloud's Terms and Conditions