C:\Users\WalkingTree>setx/ MB_DB_TYPE=postgres
SUCCESS: Specified value was saved.
C:\Users\WalkingTree>SETX / MB_DB_DBNAME=metabase
SUCCESS: Specified value was saved.
C:\Users\WalkingTree>SETX / MB_DB_PORT=5432
SUCCESS: Specified value was saved.
C:\Users\WalkingTree>SETX / MB_DB_USER=Maharshi Trivedi
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.
C:\Users\WalkingTree>SETX / MB_DB_USER= MaharshiTrivedi
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.
C:\Users\WalkingTree>SETX / MB_DB_USER=MaharshiTrivedi
SUCCESS: Specified value was saved.
C:\Users\WalkingTree>SETX / MB_DB_PASS=MTrivedi#1
SUCCESS: Specified value was saved.
C:\Users\WalkingTree>SETX / MB_DB_HOST=localhost
SUCCESS: Specified value was saved.
C:\Users\WalkingTree>java -jar C:\Users\WalkingTree\metabase.jar load-from-h2 C:\Users\WalkingTree\metabase.db
Warning: environ value C:\Program Files\Java\jdk-11.0.2 for key :java-home has been overwritten with C:\Program Files\OpenJDK\jdk-11.0.2
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-03-30 17:40:51,390 INFO metabase.util :: Maximum memory available to JVM: 3.9 GB
2022-03-30 17:41:08,608 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance.
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2022-03-30 17:41:14,152 INFO driver.impl :: Registered abstract driver :sql
? Load driver :sql took 1.3 s
2022-03-30 17:41:14,175 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql])
Load driver :sql-jdbc took 1.3 s
2022-03-30 17:41:14,185 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc])
2022-03-30 17:41:14,226 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc])
2022-03-30 17:41:14,255 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc])
2022-03-30 17:41:20,529 INFO metabase.core ::
Metabase v1.42.2 (d6ff494 release-x.42.x)
Copyright ⌐ 2022 Metabase, Inc.
Metabase Enterprise Edition extensions are PRESENT.
Usage of Metabase Enterprise Edition features are subject to the Metabase Commercial License.See https://www.metabase.com/license/commercial/ for details.
2022-03-30 17:41:20,682 WARN db.env :: 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. For more information, see https://metabase.com/docs/latest/operations-guide/migrating-from-h2.html
2022-03-30 17:41:20,687 INFO cmd.copy :: Set up h2 source database and run migrations...
2022-03-30 17:41:20,693 INFO db.setup :: Verifying h2 Database Connection ...
2022-03-30 17:41:21,358 INFO db.setup :: Successfully verified H2 1.4.197 (2018-03-18) application database connection.
2022-03-30 17:41:21,360 INFO db.setup :: Running Database Migrations...
2022-03-30 17:41:21,367 INFO db.setup :: Setting up Liquibase...
2022-03-30 17:41:21,456 INFO db.setup :: Liquibase is ready.
2022-03-30 17:41:21,457 INFO db.liquibase :: Checking if Database has unrun migrations...
2022-03-30 17:41:24,525 INFO db.setup :: Database Migrations Current ...
2022-03-30 17:41:24,526 INFO db.data-migrations :: Running all necessary data migrations, this may take a minute.
2022-03-30 17:41:24,549 INFO db.data-migrations :: Finished running data migrations.
Database setup took 3.9 s
2022-03-30 17:41:24,552 INFO cmd.copy :: [OK]
2022-03-30 17:41:24,556 INFO cmd.copy :: Set up h2 target database and run migrations...
2022-03-30 17:41:24,557 INFO db.setup :: Verifying h2 Database Connection ...
2022-03-30 17:41:24,561 INFO db.setup :: Successfully verified H2 1.4.197 (2018-03-18) application database connection.
2022-03-30 17:41:24,562 INFO db.setup :: Running Database Migrations...
2022-03-30 17:41:24,565 INFO db.setup :: Setting up Liquibase...
2022-03-30 17:41:24,583 INFO db.setup :: Liquibase is ready.
2022-03-30 17:41:24,584 INFO db.liquibase :: Checking if Database has unrun migrations...
2022-03-30 17:41:25,500 INFO db.setup :: Database Migrations Current ...
Database setup took 944.6 ms
2022-03-30 17:41:25,503 INFO cmd.copy :: [OK]
2022-03-30 17:41:25,506 INFO cmd.copy :: Testing if target h2 database is already populated...
2022-03-30 17:41:25,510 ERROR cmd.copy :: [FAIL]
clojure.lang.ExceptionInfo: ERROR Testing if target h2 database is already populated... {}
at metabase.cmd.copy$do_step$fn__81443.invoke(copy.clj:33)
at metabase.cmd.copy$do_step.invokeStatic(copy.clj:29)
at metabase.cmd.copy$do_step.invoke(copy.clj:27)
at metabase.cmd.copy$fn__81604$copy_BANG___81609$fn__81610.invoke(copy.clj:274)
at metabase.cmd.copy$fn__81604$copy_BANG___81609.invoke(copy.clj:258)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invokeStatic(load_from_h2.clj:35)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invoke(load_from_h2.clj:25)
at clojure.lang.Var.invoke(Var.java:384)
at metabase.cmd$load_from_h2.invokeStatic(cmd.clj:45)
at metabase.cmd$load_from_h2.invoke(cmd.clj:39)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at metabase.cmd$run_cmd$fn__83258.invoke(cmd.clj:190)
at metabase.cmd$run_cmd.invokeStatic(cmd.clj:190)
at metabase.cmd$run_cmd.invoke(cmd.clj:186)
at clojure.lang.Var.invoke(Var.java:388)
at metabase.core$run_cmd.invokeStatic(core.clj:141)
at metabase.core$run_cmd.invoke(core.clj:139)
at metabase.core$_main.invokeStatic(core.clj:163)
at metabase.core$_main.doInvoke(core.clj:158)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at metabase.core.main(Unknown Source)
Caused by: clojure.lang.ExceptionInfo: Target DB is already populated! {}
at metabase.cmd.copy$assert_db_empty.invokeStatic(copy.clj:160)
at metabase.cmd.copy$assert_db_empty.invoke(copy.clj:153)
at metabase.cmd.copy$fn__81604$copy_BANG___81609$fn__81610$fn__81615.invoke(copy.clj:275)
at metabase.cmd.copy$do_step$fn__81443.invoke(copy.clj:30)
... 23 more
Command failed with exception: ERROR Testing if target h2 database is already populated...
C:\Users\WalkingTree>java -jar C:\Users\WalkingTree\metabase.jar load-from-h2 C:\Users\WalkingTree\metabase
Warning: environ value C:\Program Files\Java\jdk-11.0.2 for key :java-home has been overwritten with C:\Program Files\OpenJDK\jdk-11.0.2
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-03-30 17:41:49,820 INFO metabase.util :: Maximum memory available to JVM: 3.9 GB
2022-03-30 17:42:01,152 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance.
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2022-03-30 17:42:04,016 INFO driver.impl :: Registered abstract driver :sql
? Load driver :sql took 578.4 ms
2022-03-30 17:42:04,025 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql])
Load driver :sql-jdbc took 591.1 ms
2022-03-30 17:42:04,030 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc])
2022-03-30 17:42:04,051 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc])
2022-03-30 17:42:04,064 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc])
2022-03-30 17:42:07,033 INFO metabase.core ::
Metabase v1.42.2 (d6ff494 release-x.42.x)
Copyright ⌐ 2022 Metabase, Inc.
Metabase Enterprise Edition extensions are PRESENT.
Usage of Metabase Enterprise Edition features are subject to the Metabase Commercial License.See https://www.metabase.com/license/commercial/ for details.
2022-03-30 17:42:07,120 WARN db.env :: 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. For more information, see https://metabase.com/docs/latest/operations-guide/migrating-from-h2.html
2022-03-30 17:42:07,122 INFO cmd.copy :: Set up h2 source database and run migrations...
2022-03-30 17:42:07,127 INFO db.setup :: Verifying h2 Database Connection ...
2022-03-30 17:42:07,195 ERROR cmd.copy :: [FAIL]
clojure.lang.ExceptionInfo: ERROR Set up h2 source database and run migrations... {}
at metabase.cmd.copy$do_step$fn__81443.invoke(copy.clj:33)
at metabase.cmd.copy$do_step.invokeStatic(copy.clj:29)
at metabase.cmd.copy$do_step.invoke(copy.clj:27)
at metabase.cmd.copy$fn__81604$copy_BANG___81609$fn__81610.invoke(copy.clj:265)
at metabase.cmd.copy$fn__81604$copy_BANG___81609.invoke(copy.clj:258)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invokeStatic(load_from_h2.clj:35)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invoke(load_from_h2.clj:25)
at clojure.lang.Var.invoke(Var.java:384)
at metabase.cmd$load_from_h2.invokeStatic(cmd.clj:45)
at metabase.cmd$load_from_h2.invoke(cmd.clj:39)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at metabase.cmd$run_cmd$fn__83258.invoke(cmd.clj:190)
at metabase.cmd$run_cmd.invokeStatic(cmd.clj:190)
at metabase.cmd$run_cmd.invoke(cmd.clj:186)
at clojure.lang.Var.invoke(Var.java:388)
at metabase.core$run_cmd.invokeStatic(core.clj:141)
at metabase.core$run_cmd.invoke(core.clj:139)
at metabase.core$main.invokeStatic(core.clj:163)
at metabase.core$main.doInvoke(core.clj:158)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at metabase.core.main(Unknown Source)
Caused by: clojure.lang.ExceptionInfo: Unable to connect to Metabase h2 DB. {}
at metabase.db.setup$fn__34036$verify_db_connection__34041$fn__34042$fn__34043.invoke(setup.clj:102)
at metabase.db.setup$fn__34036$verify_db_connection__34041$fn__34042.invoke(setup.clj:100)
at metabase.db.setup$fn__34036$verify_db_connection__34041.invoke(setup.clj:94)
at metabase.db.setup$setup_db_BANG$fn__34071$fn__34072.invoke(setup.clj:142)
at metabase.util$do_with_us_locale.invokeStatic(util.clj:692)
at metabase.util$do_with_us_locale.invoke(util.clj:678)
at metabase.db.setup$setup_db_BANG$fn__34071.invoke(setup.clj:141)
at metabase.db.setup$setup_db_BANG_.invokeStatic(setup.clj:140)
at metabase.db.setup$setup_db_BANG_.invoke(setup.clj:136)
at metabase.cmd.copy$fn__81604$copy_BANG___81609$fn__81610$fn__81611.invoke(copy.clj:266)
at metabase.cmd.copy$do_step$fn__81443.invoke(copy.clj:30)
... 23 more
Caused by: org.h2.jdbc.JdbcSQLException: Database "C:/Users/WalkingTree/metabase" not found [90013-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.engine.Engine.openSession(Engine.java:64)
at org.h2.engine.Engine.openSession(Engine.java:179)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)
at org.h2.engine.Engine.createSession(Engine.java:140)
at org.h2.engine.Engine.createSession(Engine.java:28)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:124)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:103)
at org.h2.Driver.connect(Driver.java:69)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
at clojure.java.jdbc$get_driver_connection.invokeStatic(jdbc.clj:271)
at clojure.java.jdbc$get_driver_connection.invoke(jdbc.clj:250)
at clojure.java.jdbc$get_connection.invokeStatic(jdbc.clj:411)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:274)
at clojure.java.jdbc$db_query_with_resultset_STAR_.invokeStatic(jdbc.clj:1111)
at clojure.java.jdbc$db_query_with_resultset_STAR_.invoke(jdbc.clj:1093)
at clojure.java.jdbc$query.invokeStatic(jdbc.clj:1182)
at clojure.java.jdbc$query.invoke(jdbc.clj:1144)
at clojure.java.jdbc$query.invokeStatic(jdbc.clj:1160)
at clojure.java.jdbc$query.invoke(jdbc.clj:1144)
at metabase.driver.sql_jdbc.connection$can_connect_with_spec_QMARK_.invokeStatic(connection.clj:245)
at metabase.driver.sql_jdbc.connection$can_connect_with_spec_QMARK_.invoke(connection.clj:242)
at metabase.db.setup$fn__34036$verify_db_connection__34041$fn__34042$fn__34043.invoke(setup.clj:100)
... 33 more
Command failed with exception: ERROR Set up h2 source database and run migrations...
C:\Users\WalkingTree>java -jar C:\Users\WalkingTree\metabase.jar load-from-h2 C:\Users\WalkingTree\metabase.db
Warning: environ value C:\Program Files\Java\jdk-11.0.2 for key :java-home has been overwritten with C:\Program Files\OpenJDK\jdk-11.0.2
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-03-30 17:42:35,025 INFO metabase.util :: Maximum memory available to JVM: 3.9 GB
2022-03-30 17:42:46,732 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance.
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2022-03-30 17:42:49,577 INFO driver.impl :: Registered abstract driver :sql
? Load driver :sql took 555.4 ms
2022-03-30 17:42:49,587 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql])
Load driver :sql-jdbc took 568.3 ms
2022-03-30 17:42:49,592 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc])
2022-03-30 17:42:49,612 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc])
2022-03-30 17:42:49,630 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc])
2022-03-30 17:42:53,394 INFO metabase.core ::
Metabase v1.42.2 (d6ff494 release-x.42.x)
Copyright ⌐ 2022 Metabase, Inc.
Metabase Enterprise Edition extensions are PRESENT.
Usage of Metabase Enterprise Edition features are subject to the Metabase Commercial License.See https://www.metabase.com/license/commercial/ for details.
2022-03-30 17:42:53,559 WARN db.env :: 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. For more information, see https://metabase.com/docs/latest/operations-guide/migrating-from-h2.html
2022-03-30 17:42:53,568 INFO cmd.copy :: Set up h2 source database and run migrations...
2022-03-30 17:42:53,573 INFO db.setup :: Verifying h2 Database Connection ...
2022-03-30 17:42:54,279 INFO db.setup :: Successfully verified H2 1.4.197 (2018-03-18) application database connection.
2022-03-30 17:42:54,280 INFO db.setup :: Running Database Migrations...
2022-03-30 17:42:54,285 INFO db.setup :: Setting up Liquibase...
2022-03-30 17:42:54,369 INFO db.setup :: Liquibase is ready.
2022-03-30 17:42:54,370 INFO db.liquibase :: Checking if Database has unrun migrations...
2022-03-30 17:42:57,651 INFO db.setup :: Database Migrations Current ...
2022-03-30 17:42:57,652 INFO db.data-migrations :: Running all necessary data migrations, this may take a minute.
2022-03-30 17:42:57,677 INFO db.data-migrations :: Finished running data migrations.
Database setup took 4.1 s
2022-03-30 17:42:57,683 INFO cmd.copy :: [OK]
2022-03-30 17:42:57,685 INFO cmd.copy :: Set up h2 target database and run migrations...
2022-03-30 17:42:57,686 INFO db.setup :: Verifying h2 Database Connection ...
2022-03-30 17:42:57,689 INFO db.setup :: Successfully verified H2 1.4.197 (2018-03-18) application database connection.
2022-03-30 17:42:57,692 INFO db.setup :: Running Database Migrations...
2022-03-30 17:42:57,696 INFO db.setup :: Setting up Liquibase...
2022-03-30 17:42:57,719 INFO db.setup :: Liquibase is ready.
2022-03-30 17:42:57,720 INFO db.liquibase :: Checking if Database has unrun migrations...
2022-03-30 17:42:58,676 INFO db.setup :: Database Migrations Current ...
Database setup took 990.9 ms
2022-03-30 17:42:58,680 INFO cmd.copy :: [OK]
2022-03-30 17:42:58,682 INFO cmd.copy :: Testing if target h2 database is already populated...
2022-03-30 17:42:58,686 ERROR cmd.copy :: [FAIL]
clojure.lang.ExceptionInfo: ERROR Testing if target h2 database is already populated... {}
at metabase.cmd.copy$do_step$fn__81443.invoke(copy.clj:33)
at metabase.cmd.copy$do_step.invokeStatic(copy.clj:29)
at metabase.cmd.copy$do_step.invoke(copy.clj:27)
at metabase.cmd.copy$fn__81604$copy_BANG___81609$fn__81610.invoke(copy.clj:274)
at metabase.cmd.copy$fn__81604$copy_BANG___81609.invoke(copy.clj:258)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invokeStatic(load_from_h2.clj:35)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invoke(load_from_h2.clj:25)
at clojure.lang.Var.invoke(Var.java:384)
at metabase.cmd$load_from_h2.invokeStatic(cmd.clj:45)
at metabase.cmd$load_from_h2.invoke(cmd.clj:39)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at metabase.cmd$run_cmd$fn__83258.invoke(cmd.clj:190)
at metabase.cmd$run_cmd.invokeStatic(cmd.clj:190)
at metabase.cmd$run_cmd.invoke(cmd.clj:186)
at clojure.lang.Var.invoke(Var.java:388)
at metabase.core$run_cmd.invokeStatic(core.clj:141)
at metabase.core$run_cmd.invoke(core.clj:139)
at metabase.core$_main.invokeStatic(core.clj:163)
at metabase.core$_main.doInvoke(core.clj:158)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at metabase.core.main(Unknown Source)
Caused by: clojure.lang.ExceptionInfo: Target DB is already populated! {}
at metabase.cmd.copy$assert_db_empty.invokeStatic(copy.clj:160)
at metabase.cmd.copy$assert_db_empty.invoke(copy.clj:153)
at metabase.cmd.copy$fn__81604$copy_BANG___81609$fn__81610$fn__81615.invoke(copy.clj:275)
at metabase.cmd.copy$do_step$fn__81443.invoke(copy.clj:30)
... 23 more
Command failed with exception: ERROR Testing if target h2 database is already populated...
I am trying to migrate my database from h2 to postgres.This is the error showing.Please help and check if command line functions are proper

