Metabase Crashing after H2 Postgres Migration

Hello, Yesterday I migrated to Postgres, yet today Metabase is still crashing. The error I get is below. I tried using kill -9 [number], but then I lose my work.
Messages:
INFO metabase.db :: Verifying h2 Database Connection …
INFO driver.impl :: Initializing driver :sql…
INFO driver.impl :: Initializing driver :sql-jdbc…
INFO driver.impl :: Initializing driver :h2…
ERROR driver.util :: Database connection error
org.h2.jdbc.JdbcSQLException: Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode [90020-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:188)
at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:168)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
at org.h2.engine.Database.getPageStore(Database.java:2538)
at org.h2.engine.Database.open(Database.java:709)
at org.h2.engine.Database.openDatabase(Database.java:286)
at org.h2.engine.Database.(Database.java:280)
at org.h2.engine.Engine.openSession(Engine.java:66)
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(Unknown Source)

Hi @nicola
You probably have multiple processes running. And you are still using H2.
Post the command you are using to start Metabase.

oh, ok. Thank you for your reply. I am just opening it by clicking on the icon. I am running it locally on my Mac.

@nicola Then you’re not using Postgres.
The app is running somewhere - try restarting your computer.
But you will still be using H2 on the Mac App.

I see, thank you very much. When I run Metabase.jar, I get to the “Metabase Initialization COMPLETE” line, but then it just sits there forever, never getting to the “Launching Embedded Jetty Webserver with config:” line or anywhere past that. Also I still get the H2 warning in the terminal printout and looks like it is connecting to H2, even though I migrated to postgres yesterday! And the migration was successful.

@nicola You need to be very careful what you do, since now you are using multiple different versions and different application databases, so data will be saved differently.

When you start using Java, and you see Metabase Initialization COMPLETE, then you can access Metabase through http://localhost:3000

If you have migrated to Postgres, then remove the Mac App - you don’t need that anymore, ever.

But again - post the exact commands you’re using to start, migrate, whatever.

I did not know that! I recreated the postgres database, remigrated, and am now running Metabase.jar. I will delete the Metabase app! It is working great. Thank you so much for your help.

How do you end Metabase.jar? I closed local host and exited the terminal to stop Metabase, but when I reopened it again, I lost my work. Is there a way to ensure the questions are saved?

@nicola Post the commands you are using.

To launch Metabase, I use java -jar metabase.jar. Then I go to http://localhost:3000 to access and work on Metabase. When I finished, I closed http://localhost:3000 and closed out of the terminal. When I ran Metabase again, using java -jar metabase.jar, and any questions I had created were gone.

@nicola When you just start with that command, then Metabase just uses H2 - unless you are using environment variables, but you’re not indicating that.
Use this instead:

java -DMB_DB_CONNECTION_URI="postgres://<host>:<port>/<database>?user=<username>&password=<password>" -jar metabase.jar

Ok thank you. And when one wants to end Metabase and close out of terminal, how does one do that?

@nicola You just end the process - CTRL+C or perhaps it’s Command+C on Mac.

Oh ok, thank you SO much for all of your help. I really appreciate it!