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.
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(
at org.h2.message.DbException.get(
at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(
at org.h2.mvstore.db.MVTableEngine$
at org.h2.mvstore.db.MVTableEngine.init(
at org.h2.engine.Database.getPageStore(
at org.h2.engine.Database.openDatabase(
at org.h2.engine.Database.(
at org.h2.engine.Engine.openSession(
at org.h2.engine.Engine.openSession(
at org.h2.engine.Engine.createSessionAndValidate(
at org.h2.engine.Engine.createSession(
at org.h2.engine.Engine.createSession(
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(
at org.h2.jdbc.JdbcConnection.(
at org.h2.jdbc.JdbcConnection.(
at org.h2.Driver.connect(
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!