Skip to content
Snippets Groups Projects
serialization.md 3.06 KiB
Newer Older
Maz Ameli's avatar
Maz Ameli committed
## Copying contents of one Metabase instance to another

Maz Ameli's avatar
Maz Ameli committed
Metabase's serialization feature allows you to create a snapshot, called a dump, of the contents of a Metabase instance that can then be loaded into another instance.
Maz Ameli's avatar
Maz Ameli committed

This lets you do things like create a set of dashboards in one Metabase instance and then easily copy those dashboards to a number of other Metabase instances that you've set up for your customers. You could also use this feature to enable a staging-to-production workflow for important dashboards or reports by dumping from a staging instance of Metabase and then loading that dump into your production instance(s).

### What gets dumped and loaded
Maz Ameli's avatar
Maz Ameli committed
**Currently a dump consists of the following Metabase artifacts:**
Maz Ameli's avatar
Maz Ameli committed
* Collections
* Dashboards
* Saved questions
* Pulses
* Segments and Metrics defined in the Data Model
* Archived collections, dashboards, saved questions, or pulses
Maz Ameli's avatar
Maz Ameli committed
* Public sharing settings for questions and dashboards
Maz Ameli's avatar
Maz Ameli committed

Maz Ameli's avatar
Maz Ameli committed
**It also contains a number of system settings:**
Maz Ameli's avatar
Maz Ameli committed
* Admin Panel settings, except for permissions
* Database connection settings
* Data Model settings

Maz Ameli's avatar
Maz Ameli committed
**The dump does _not_ contain:**
Maz Ameli's avatar
Maz Ameli committed
* Permission settings
* User accounts or settings
* Alerts on saved questions
Maz Ameli's avatar
Maz Ameli committed
* Personal Collections or their contents (except for the user specified with the `--user` flag; see below)
Maz Ameli's avatar
Maz Ameli committed

### Before creating or loading a dump
Maz Ameli's avatar
Maz Ameli committed
If your instance is currently running, you will need to stop it first before creating or loading a dump, unless your Metabase application database supports concurrent reads. The default application database type, H2, does not.
Maz Ameli's avatar
Maz Ameli committed

### Creating a data dump
To create a dump of a Metabase instance, use the following command in your terminal:

`java -jar metabase.jar dump [dump_name] --user [example@example.com]`

Maz Ameli's avatar
Maz Ameli committed
The optional `--user` flag is used to specify a default administrator account for cases when this dump is loaded into a blank Metabase instance. This user will also be marked as the creator of all artifacts that are copied over to the instance. This user's personal collection and its contents will also be included in the data dump. If this flag isn't specified, it's assumed that the instance into which you're loading already has an admin user.
Maz Ameli's avatar
Maz Ameli committed

Maz Ameli's avatar
Maz Ameli committed
### Loading a dump
To load a dump into another instance of Metabase, use the following command, where `[my_dump]` is the path to the dump you want to load:
Maz Ameli's avatar
Maz Ameli committed

`java -jar metabase.jar load [my_dump] --mode [skip/update] --on-error [continue/abort]`

Maz Ameli's avatar
Maz Ameli committed
The `--mode` flag lets you specify what to do when encountering a duplicate dashboard, question, or any Admin Panel settings that already set (again, except for permissions and user settings, which are not currently included in data dumps). It can either `skip` that item and do nothing to it, or `update` it with the version being loaded. The default is `skip`.
Maz Ameli's avatar
Maz Ameli committed

The `--on-error` flag allows you to specify whether the load process should keep going or stop when there's an error. The default is `continue`.

Both of these flags are optional.
Maz Ameli's avatar
Maz Ameli committed

---

## That's it!
Still need help? Feel free to reach out to us at the support email address you were provided.