Skip to content
Tools for managing Metabase
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
metabase-exporter Add new command to test questions Dec 4, 2018
.gitattributes Add .gitignore and .gitattributes. Jun 14, 2018
.gitignore Add .gitignore and .gitattributes. Jun 14, 2018
Dockerfile #4 dockerfile Jul 17, 2018
LICENSE Create LICENSE Aug 22, 2018
README.md Update README.md Aug 1, 2018
metabase-exporter.sln Add project files. Jun 14, 2018

README.md

elevate.metabase.tools

Tools for managing Metabase .

Docker images on docker hub.

Metabase-exporter

Used to export/import the current state of Metabase (questions/dashboards/collections) to/from a JSON file. This file can then be stored on git for versioning.

Limitations

This tool currently exports/imports collections, dashboards and SQL-defined questions only. Other kinds of questions are not supported because they are hard to make portable across Metabase instances. Other features (e.g. pulses) are not supported simply because I don't need them :)

Usage

Parameters can be given via command-line, appsettings.json or environment variables. There are two modes of operation, given by the Command parameter: import or export.

Regardless of the operation, the Metabase API settings must be configured. E.g. in appsettings.json:

{
  "MetabaseApi": {
    "Url": "https://metabase-local.elevatedirect.com:32443",
    "Username": "mauricio@elevatedirect.com",
    "Password":  "123456789"
  }
}

Export

This exports the state to a file. Sample usage:

metabase-exporter.exe Command=export OutputFilename=metabase-state.json

Import

This imports a state file into a Metabase instance. Sample usage:

metabase-exporter.exe Command=import InputFilename=metabase-state.json DatabaseMapping:1=2 DatabaseMapping:2=3

The DatabaseMapping settings map Metabase database IDs in the state file to database IDs in the target Metabase instance. In the example above, it maps:

  • the database ID 1 in the file to the database ID 2 in the target Metabase instance
  • the database ID 2 in the file to the database ID 3 in the target Metabase instance
You can’t perform that action at this time.