Can not restore dashboard and questions from metabase.db.mv.db file

#1

I am trying to recovery metabase from h2 metabase file.
But the dashboard and questions are not displaying.
Also followed this page but it still not working.
Can someone give me an advise ?
Here are metabase’s info.

Metabase version:  0.32.8
java -jar -DMB_DB_FILE=/home/ec2-user/backup_db/metabase.db /opt/metabase/metabase.jar

※ metabase.db.mv.db is a file which i copy from another running metabase service.

#2

Hi @huynhit92

Are you running the command as the user ec2-user ? Since it’s located in the home directory of that user.
So the actual file has this path /home/ec2-user/backup_db/metabase.db.mv.db ?

What do you see in the log, when starting Metabase? It should tell you if it might have issues with permissions or something like that.

Also, you should always use the documentation for the version you’re using:
https://metabase.com/docs/v0.32.8/operations-guide/start.html#backing-up-metabase-application-data

#3

Hi @flamber
Yeah, I am running as the user ec2-user.
Here is the log file.

06-10 14:35:14 INFO metabase.util :: Loading Metabase...
06-10 14:35:14 INFO metabase.util :: Maximum memory available to JVM: 864.0 MB
06-10 14:35:18 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. 🔓 
 For more information, see https://metabase.com/docs/latest/operations-guide/start.html#encrypting-your-database-connection-details-at-rest
06-10 14:35:22 INFO metabase.driver :: Registered abstract driver :sql  🚚
06-10 14:35:27 INFO metabase.core :: Starting Metabase in STANDALONE mode
06-10 14:35:27 INFO metabase.server :: Launching Embedded Jetty Webserver with config: 
 {:port 3000}

06-10 14:35:27 INFO metabase.core :: Starting Metabase version v0.32.8 (16be46d release-0.32.x) ...
06-10 14:35:27 INFO metabase.core :: System timezone is 'Asia/Tokyo' ...
06-10 14:35:27 INFO metabase.plugins :: Loading plugins in /home/ec2-user/plugins...
06-10 14:35:27 DEBUG plugins.classloader :: Setting current thread context classloader to NEWLY CREATED classloader clojure.lang.DynamicClassLoader@22717282...
06-10 14:35:27 INFO plugins.dependencies :: Metabase cannot initialize plugin Metabase Vertica Driver due to required dependencies. Metabase requires the Vertica JDBC driver in order to connect to Vertica databases, but we can't ship it as part of Metabase due to licensing restrictions. See https://metabase.com/docs/latest/administration-guide/databases/vertica.html for more details.

06-10 14:35:27 INFO plugins.dependencies :: Metabase Vertica Driver dependency {:class com.vertica.jdbc.Driver} satisfied? false
06-10 14:35:27 INFO plugins.dependencies :: Plugins with unsatisfied deps: ["Metabase Vertica Driver"]
06-10 14:35:27 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :sqlserver...
06-10 14:35:28 INFO metabase.driver :: Registered abstract driver :sql-jdbc (parents: :sql) 🚚
Load driver :sql-jdbc took 40 ms
06-10 14:35:28 INFO metabase.driver :: Registered driver :sqlserver (parents: #{:sql-jdbc}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :sqlite...
06-10 14:35:28 INFO metabase.driver :: Registered driver :sqlite (parents: #{:sql-jdbc}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :hive-like...
06-10 14:35:28 INFO metabase.driver :: Registered abstract driver :hive-like (parents: #{:sql-jdbc}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :sparksql...
06-10 14:35:28 INFO metabase.driver :: Registered driver :sparksql (parents: #{:hive-like}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :snowflake...
06-10 14:35:28 INFO metabase.driver :: Registered driver :snowflake (parents: #{:sql-jdbc}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :redshift...
06-10 14:35:28 INFO metabase.driver :: Registered driver :postgres (parents: :sql-jdbc) 🚚
Load driver :postgres took 21 ms
06-10 14:35:28 INFO metabase.driver :: Registered driver :redshift (parents: #{:postgres}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :presto...
06-10 14:35:28 INFO metabase.driver :: Registered driver :presto (parents: #{:sql}) 🚚
06-10 14:35:28 INFO plugins.dependencies :: Metabase cannot initialize plugin Metabase Oracle Driver due to required dependencies. Metabase requires the Oracle JDBC driver in order to connect to Oracle databases, but we can't ship it as part of Metabase due to licensing restrictions. See https://metabase.com/docs/latest/administration-guide/databases/oracle.html for more details.

06-10 14:35:28 INFO plugins.dependencies :: Metabase Oracle Driver dependency {:class oracle.jdbc.OracleDriver} satisfied? false
06-10 14:35:28 INFO plugins.dependencies :: Plugins with unsatisfied deps: ["Metabase Oracle Driver" "Metabase Vertica Driver"]
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :mongo...
06-10 14:35:28 INFO metabase.driver :: Registered driver :mongo  🚚
06-10 14:35:28 INFO plugins.dependencies :: Plugin 'Metabase Google Analytics Driver' depends on plugin 'Metabase Google Drivers Shared Dependencies'
06-10 14:35:28 INFO plugins.dependencies :: Metabase Google Analytics Driver dependency {:plugin Metabase Google Drivers Shared Dependencies} satisfied? false
06-10 14:35:28 INFO plugins.dependencies :: Plugins with unsatisfied deps: ["Metabase Oracle Driver" "Metabase Vertica Driver" "Metabase Google Analytics Driver"]
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :google...
06-10 14:35:28 INFO metabase.driver :: Registered abstract driver :google  🚚
06-10 14:35:28 INFO plugins.dependencies :: Metabase Google Analytics Driver dependency {:plugin Metabase Google Drivers Shared Dependencies} satisfied? true
06-10 14:35:28 DEBUG plugins.initialize :: Dependencies satisfied; these plugins will now be loaded: ["Metabase Google Analytics Driver"]
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :googleanalytics...
06-10 14:35:28 INFO metabase.driver :: Registered driver :googleanalytics (parents: #{:google}) 🚚
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :druid...
06-10 14:35:28 INFO metabase.driver :: Registered driver :druid  🚚
06-10 14:35:28 INFO plugins.dependencies :: Plugin 'Metabase BigQuery Driver' depends on plugin 'Metabase Google Drivers Shared Dependencies'
06-10 14:35:28 INFO plugins.dependencies :: Metabase BigQuery Driver dependency {:plugin Metabase Google Drivers Shared Dependencies} satisfied? true
06-10 14:35:28 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :bigquery...
06-10 14:35:28 INFO metabase.driver :: Registered driver :bigquery (parents: #{:sql :google}) 🚚
06-10 14:35:28 INFO metabase.driver :: Registered driver :h2 (parents: :sql-jdbc) 🚚
Load driver :h2 took 16 ms
06-10 14:35:28 INFO metabase.driver :: Registered driver :mysql (parents: :sql-jdbc) 🚚
Load driver :mysql took 20 ms
06-10 14:35:28 INFO metabase.core :: Setting up and migrating Metabase DB. Please sit tight, this may take a minute...
06-10 14:35:28 WARN metabase.db :: WARNING: Using Metabase with an H2 application database is not recommended for production deployments. For production deployments, we highly recommend using Postgres, MySQL, or MariaDB instead. If you decide to continue to use H2, please be sure to back up the database file regularly. See https://metabase.com/docs/latest/operations-guide/start.html#migrating-from-using-the-h2-database-to-mysql-or-postgres for more information.
06-10 14:35:28 INFO metabase.db :: Verifying h2 Database Connection ...
06-10 14:35:28 INFO metabase.driver :: Initializing driver :sql...
06-10 14:35:28 INFO metabase.driver :: Initializing driver :sql-jdbc...
06-10 14:35:28 INFO metabase.driver :: Initializing driver :h2...
06-10 14:35:29 INFO metabase.db :: Verify Database Connection ...  ✅
06-10 14:35:29 INFO metabase.db :: Running Database Migrations...
06-10 14:35:29 INFO metabase.db :: Setting up Liquibase...
06-10 14:35:29 INFO metabase.db :: Liquibase is ready.
06-10 14:35:29 INFO metabase.db :: Checking if Database has unrun migrations...
06-10 14:35:31 INFO metabase.db :: Database Migrations Current ...  ✅
06-10 14:35:31 INFO db.migrations :: Running all necessary data migrations, this may take a minute.
06-10 14:35:31 INFO db.migrations :: Finished running data migrations.
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.activity-feed 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.dependencies 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.driver-notifications 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.last-login 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.metabot-lifecycle 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.notifications 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.revision 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.sync-database 👂
06-10 14:35:31 INFO metabase.events :: Starting events listener: metabase.events.view-log 👂
06-10 14:35:31 INFO metabase.task :: Initializing task SyncDatabases 📆
06-10 14:35:32 INFO metabase.task :: Initializing task CheckForNewVersions 📆
06-10 14:35:32 INFO metabase.task :: Initializing task SendAnonymousUsageStats 📆
06-10 14:35:32 INFO metabase.task :: Initializing task SendAbandomentEmails 📆
06-10 14:35:32 INFO metabase.task :: Initializing task SendPulses 📆
06-10 14:35:32 INFO metabase.task :: Initializing task SendFollowUpEmails 📆
06-10 14:35:32 INFO metabase.task :: Initializing task TaskHistoryCleanup 📆
06-10 14:35:32 INFO metabase.core :: Metabase Initialization COMPLETE

#4

@huynhit92
Do you normally run it with environment variables? Maybe one of those is creating a conflict.
Is the actual full file path /home/ec2-user/backup_db/metabase.db.mv.db ?

java -DMB_DB_TYPE=h2 -DMB_DB_FILE=/home/ec2-user/backup_db/metabase.db -jar /opt/metabase/metabase.jar
#5


Nothing happened , it became normal setup screen without any question or dashboard

#6

@huynhit92
That screen is the startup screen - not the setup.

Okay, I don’t know what’s happening with your installation. Then just use the environment variables:

export MB_DB_TYPE=h2
export MB_DB_FILE=/home/ec2-user/backup_db/metabase.db
java -jar /opt/metabase/metabase.jar
#7

@flamber
It still become startup screen.
Is there any problem may occur with my metabase.db file ?

#8

@huynhit92
Maybe, but there should be some errors if the file is corrupted. But it’s not recommended to use H2 in production, you should migrate to different database.
Run this:

ls -l /home/ec2-user/backup_db/metabase.db.mv.db