You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description" : "Returns object containing default user details for initial setup, if configured,\n and if the provided token value matches the token in the configuration value.",
CLI commands for managing your Metabase instance, including database
13
+
migrations, serialization, and administrative tasks.
11
14
latest: true
12
15
---
13
16
14
17
# Metabase CLI
15
18
16
-
Metabase ships with some handy CLI commands. To view a list of commands, run the Metabase jar followed by `help`.
19
+
Metabase ships with some handy CLI commands for administration, maintenance, and automation tasks. These commands let you manage your Metabase instance, migrate databases, handle serialization, and generate documentation.
20
+
21
+
To view a list of commands, run the Metabase jar followed by `help`.
17
22
18
23
```
19
24
java --add-opens java.base/java.nio=ALL-UNNAMED -jar metabase.jar help
20
25
```
21
26
22
27
Metabase will print out the help text for available commands.
23
28
29
+
24
30
## `api-documentation`
25
31
26
-
Generate a markdown file containing documentation for all API endpoints. This is written to a file called `docs/api.html`.
32
+
Generate an HTML and JSON files for all API endpoints.
27
33
28
-
## `driver-methods` | `driver-methods _docs`
34
+
## `command-documentation`
29
35
30
-
Print a list of all multimethods available for a driver to implement. Add `_docs`to include their docstrings.
36
+
Generates a markdown file containing documentation for all CLI commands. This is written to a file called `docs/installation-and-operation/commands.md`.
31
37
32
38
## `config-template`
33
39
34
-
Generates a Markdown file with documentation and an example configuration file in YAML. The YAML template includes Metabase settings and their defaults. Metabase will save the file as `docs/configuring-metabase/config-template.md`.
35
-
36
-
## `drop-entity-ids`
37
-
38
-
Drop Entity IDs for instances of serializable models. Useful for migrating from v1 serialization (x.46 and earlier) to v2 (x.47+).
40
+
Generates a markdown file with some documentation and an example configuration file in YAML. The YAML template includes Metabase settings and their defaults. Metabase will save the template as `docs/configuring-metabase/config-template.md`.
39
41
40
-
## `dump path & options`
42
+
## `driver-methods | driver-methods _docs`
41
43
42
-
**Note: this command is deprecated. Use `export` instead.**
44
+
Print a list of all multimethods available for a driver to implement, optionally with their docstrings.
43
45
44
-
Serializes Metabase instance into directory `path`.
45
-
46
-
Options:
46
+
## `drop-entity-ids`
47
47
48
-
-`-u, --user EMAIL` - Export collections owned by the specified user
49
-
-`-s, --state (active|all)` - When set to `active`, do not dump archived entities. Default behavior is `all`
50
-
-`--include-entity-id` - Include entity_id property in all dumped entities. Default: false
48
+
Drop entity IDs for instances of serializable models. Useful for migrating from v1 serialization (x.46 and earlier) to v2 (x.47+).
51
49
52
-
## `dump-to-h2 h2-filename & opts`
50
+
## `dump-to-h2 h2-filename opts`
53
51
54
52
Transfer data from existing database to newly created H2 DB with specified filename. Target H2 file is deleted before dump, unless the --keep-existing flag is given.
55
53
56
54
Options:
57
55
58
-
-`-k, --keep-existing` - Do not delete target H2 file if it exists
59
-
-`-p, --dump-plaintext` - Do not encrypt dumped contents
56
+
-`-k, --keep-existing` - Do not delete target H2 file if it exists.
57
+
-`-p, --dump-plaintext` - Do not encrypt dumped contents.
60
58
61
59
## `environment-variables-documentation`
62
60
63
61
Generates a markdown file containing documentation for environment variables relevant to configuring Metabase. The command only includes environment variables registered as defsettings. For a full list of environment variables, see https://www.metabase.com/docs/latest/configuring-metabase/environment-variables.
64
62
65
-
## `export path & options`
66
-
67
-
{% include plans-blockquote.html feature="Serialization" self-hosted-only="true" %}
63
+
## `export path options`
68
64
69
65
Serialize Metabase instance into directory at `path`.
70
66
71
67
Options:
72
68
73
-
-`-c, --collection ID` - Export only specified ID(s). Use commas to separate multiple IDs. You can pass Entity IDs with `eid:<...>` as a prefix
74
-
-`-C, --no-collections` - Do not export any content in collections
69
+
-`-c, --collection ID` - Export only specified ID(s). Use commas to separate multiple IDs. Pass either PKs or entity IDs.
70
+
-`-C, --no-collections` - Do not export any content in collections.
75
71
-`-S, --no-settings` - Do not export settings.yaml
76
-
-`-D, --no-data-model` - Do not export any data model entities; useful for subsequent exports
77
-
-`-f, --include-field-values` - Include field values along with field metadata
78
-
-`-s, --include-database-secrets` - Include database connection details (in plain text; use caution)
79
-
-`-e, --continue-on-error` - Do not break execution on errors
80
-
-`--full-stacktrace` - Output full stacktraces on errors
81
-
82
-
## `help command-name` | `help`
72
+
-`-D, --no-data-model` - Do not export any data model entities; useful for subsequent exports.
73
+
-`-f, --include-field-values` - Include field values along with field metadata.
74
+
-`-s, --include-database-secrets` - Include database connection details (in plain text; use caution).
75
+
-`-e, --continue-on-error` - Do not break execution on errors.
76
+
-`--full-stacktrace` - Output full stacktraces on errors.
83
77
84
-
Show this help message listing valid Metabase commands. Use `help command-name` for specific command details.
78
+
## `help command-name | help`
85
79
86
-
## `import path & options`
80
+
Show this help message listing valid Metabase commands.
87
81
88
-
{% include plans-blockquote.html feature="Serialization" self-hosted-only="true" %}
82
+
## `import path options`
89
83
90
-
Load serialized Metabase instance as created by the `export` command from directory `path`.
84
+
Load serialized Metabase instance as created by the [[export]] command from directory `path`.
91
85
92
86
Options:
93
87
94
-
-`-e, --continue-on-error` - Do not break execution on errors
95
-
-`--full-stacktrace` - Output full stacktraces on errors
88
+
-`-e, --continue-on-error` - Do not break execution on errors.
89
+
-`--full-stacktrace` - Output full stacktraces on errors.
96
90
97
-
## `load path & options`
98
-
99
-
**Note: this command is deprecated. Use `import` instead.**
100
-
101
-
Load serialized Metabase instance as created by `dump` command from directory `path`.
102
-
103
-
Options:
104
-
105
-
-`-m, --mode (skip|update)` - Update or skip on conflicts. Default: skip
106
-
-`-e, --on-error (continue|abort)` - Abort or continue on error. Default: continue
Transfer data from existing H2 database to the newly created MySQL or Postgres DB specified by env vars.
111
94
112
95
## `migrate direction`
113
96
114
-
Run database migrations. Valid options for `direction` are `up`, `force`, `down`, `print`, or `release-locks`.
97
+
Run database migrations. Valid options for `direction` are `up`, `force`, `down`, `down-force`, `print`, or `release-locks`.
115
98
116
-
## `profile`
99
+
## `remove-encryption`
117
100
118
-
Start Metabase the usual way and exit. Useful for profiling Metabase launch time.
101
+
Decrypts data in the metabase database. The MB_ENCRYPTION_SECRET_KEY environment variable has to be set to the current key
119
102
120
103
## `reset-password email-address`
121
104
@@ -125,13 +108,9 @@ Reset the password for a user with `email-address`.
125
108
126
109
Rotate the encryption key of a metabase database. The MB_ENCRYPTION_SECRET_KEY environment variable has to be set to the current key, and the parameter `new-key` has to be the new key. `new-key` has to be at least 16 chars.
127
110
128
-
## `remove-encryption`
129
-
130
-
Decrypts data in the metabase database. The MB_ENCRYPTION_SECRET_KEY environment variable has to be set to the current key.
131
-
132
111
## `seed-entity-ids`
133
112
134
-
Add Entity IDs for instances of serializable models that don't already have them.
113
+
Add entity IDs for instances of serializable models that don't already have them.
0 commit comments