-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs - troubleshooting guide: load from h2 (#17209)
- Loading branch information
1 parent
0e4aaed
commit 221f097
Showing
5 changed files
with
86 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Loading exported application database fails | ||
|
||
If you've been using the default H2 application database that ships with Metabase, and want to [migrate from the default H2 application database][migrate] to a production database like [PostgreSQL][postgres] or MySQL/MariaDB, you'll need to use the `load-from-h2` command, which will fail if the database filename is incorrect. | ||
|
||
**How to detect this:** When running the `load-from-h2` command, you'll see an error that looks something like: | ||
|
||
``` | ||
Command failed with exception: Unsupported database file version or invalid file header in file <YOUR FILENAME> | ||
``` | ||
|
||
**How to fix this:** First, make sure to create a copy of the exported H2 database (see [Backing up Metabase Application Data][backup]). | ||
|
||
Next, check that the exported, application database file (the H2 database you exported) is named `metabase.db.mv.db`. H2 automatically adds a `.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 the `.mv.db` extension. | ||
|
||
For example, if you've exported an application database, and you want to load the data from that H2 database into a PostgreSQL database using `load-from-h2`, your command will look something like: | ||
|
||
``` | ||
export MB_DB_TYPE=postgres | ||
export MB_DB_DBNAME=metabase | ||
export MB_DB_PORT=5432 | ||
export MB_DB_USER=<username> | ||
export MB_DB_PASS=<password> | ||
export MB_DB_HOST=localhost | ||
java -jar metabase.jar load-from-h2 /path/to/metabase.db # do not include .mv.db | ||
``` | ||
|
||
If you're using Metabase Enterprise Edition, you should check out the [Serialization][serialization-docs] feature to snapshot your application database. Serialization is useful when you want to [preload questions and dashboards][serialization-learn] in a new Metabase instance. | ||
|
||
[backup]: ../operations-guide/backing-up-metabase-application-data.html | ||
[migrate]: ../operations-guide/migrating-from-h2.html | ||
[postgres]: https://www.postgresql.org/ | ||
[serialization-docs]: ../enterprise-guide/serialization.html | ||
[serialization-learn]: https://www.metabase.com/learn/administration/serialization.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters