Metabase provides limited support for migrating from H2 to Postgres or MySQL if you decide to upgrade to a more production-ready database. See Migrating from H2 to MySQL or Postgres for more details. H2 (default) For production installations of Metabase we recommend that users replace the H2 database with a more robust option such as Postgres. Metabase provides a custom migration command for upgrading H2 application database files by copying their data to a new database. Here’s what you’ll want to do. Shutdown your Metabase instance so that it’s not running. This ensures no accidental data gets written to the db while migrating.
- Metabase Migrate H2 To Mysql Server
- Metabase Migrate H2 To Mysql Database
- Metabase Migrate H2 To Mysql Download
- Metabase Migrate H2 To Mysql Online
- Deliver and maintain services, like tracking outages and protecting against spam, fraud, and abuse
- Measure audience engagement and site statistics to understand how our services are used
Metabase Migrate H2 To Mysql Server
If you agree, we’ll also use cookies and data to:- Improve the quality of our services and develop new ones
- Deliver and measure the effectiveness of ads
- Show personalized content, depending on your settings
- Show personalized or generic ads, depending on your settings, on Google and across the web
Click “Customize” to review options, including controls to reject the use of cookies for personalization and information about browser-level controls to reject some or all cookies for other uses. You can also visit g.co/privacytools anytime.
v0.39.0.1 / Operations Guide / Migrating From H2
If you decide to use the default application database (H2) when you initially start using Metabase, but later decide that you’d like to switch to a more production-ready database such as MySQL or Postgres, we make the transition easy for you. Mac or pc for work.
Metabase provides a custom migration command for upgrading H2 application database files by copying their data to a new database. Here’s what you’ll want to do:
- Shutdown your Metabase instance so that it’s not running. This ensures no accidental data gets written to the db while migrating.
- Make a backup copy of your H2 application database by following the instructions in Backing up Metabase Application Data. Safety first!
- Run the Metabase data migration command using the appropriate environment variables for the target database you want to migrate to. You can find details about specifying MySQL and Postgres databases at Configuring the application database. Here’s an example of migrating to Postgres:
It is expected that you will run the command against a brand-new (empty!) database; Metabase will handle all of the work of creating the database schema and migrating the data for you.
Metabase Migrate H2 To Mysql Database
Notes
Metabase Migrate H2 To Mysql Download
- Avoid upgrading and migrating at the same time, since it can cause problems with one of database schemas not matching.
- It is required that you can connect to the target MySQL or Postgres database in whatever environment you are running this migration command in. So, if you are attempting to move the data to a cloud database, make sure you take that into consideration.
- For MySQL or MariaDB, the minimum recommended version is MySQL 5.7.7 and MariaDB 10.2.2, while the following is required:
utf8mb4_unicode_ci
collation,utf8mb4
character set, andinnodb_large_prefix=ON
. - For PostgreSQL, the minimum version is PostgreSQL 9.4, since the code that handles these migrations uses a command that is only available in version 9.4 or newer.
- H2 automatically adds a
.h2.db
or.mv.db
extension to the database path you specify, so make sure the path to the DB file you pass to the command does not include it. For example, if you have a file named/path/to/metabase.db.h2.db
, call the command withload-from-h2 /path/to/metabase.db
.