Every time I CTRL-C the cmd window my H2 database resets to default 19kb

I was able to upgrade to 0.40 w/java 11. Noticed that CMD window must be run and stay open for metabase to run.

i have hours and hours of edits on the apps file. wanted to back it up (currently locked) so i exited the command window. the system overwrote my apps database to the default one.

You say to backup the H2 frequently due to possible instability. i dont see how to do this with out zapping it every time i exit the command window.

PLEASE, help.

It's telling you to never, ever use H2 in a production system. Install Progres or MySQL (if you really must) and migrate.
Much easier than posting another question on here in a few months time along the lines of 'My H2 database has corrupted and I've lost all my work'.

Thanks Andrew, if this is the reason. I already have SQLite on my system as its the main query database. Can I use this for H2 conversion? If not, which of the available is the simplest to configure?

  • regis

The only choice is Postgres or MySQL. Personally, I always go for Postgres but the choice is yours.

one more thing.. recently moved to java 8 to 11 on an x64 windows 10 box. best to install java11(x64) then?

and last... will run MB as a service. used nssm for years successfully but on this upgrade to java 11 and mv 0.40 that doesn't work anymore. saw above to migrate H2 to mariaDB. will nssm work that way?

  • regis

please give a bit of assistance in migrating to Postgress. im in circles here.
I have installed Postgress
I take it that first i must create an empty database but i want it in a specific windows folder.
Using runsql.bat to invoke postgress command line
what is the precise command line look like? every time i try for example

createdb c:\program files (x86)\pospreports\metabaseappdb

it returns with a prompt for database[postgress]. is that where i enter the path instead?
apologies for this very basic questioning, but not familiar with postgress.

I would super strongly recommend that if you haven’t installed a database technology before you should use a hosted db (eg Amazon rds)

Remember that this is the place where metabase will save everything, if you haven’t used Postgres before you might lose everything. It’s not just the db: it’s also backups and tuning

1 Like

SQLite3 looks to be a better choice for non dba folks. Im going to go that way. can you just confirm that I can run Mb as a service with sqlite?
( I could not run H2 metabase as a service on v0.40/Java11 but did run as a service for years on Java 8/mb v0.38)

As Luiggi said, Postgres is quite a big beast.
Forget about using the cmd line to create DB etc - too easy to make a mistake. Use PgAdmin and you'll be much more comfortable.

There's no notion of Postgres using a specific folder. Just let it manage it's own stuff - you have enough to worry about.

Don't worry about using a service yet. Get it working using a bat file, then worry about the service.

This can be closed. by running Java as a service problem dissapeared Used nssm successfully for java11 and version 0.40.8. can stop the service with no effect on the H1 database.

For anyone interested, here's an easy way to get Metabase running as a windows service, which and be easily stopped and started for purpose of backing up the db.mv.db file. Every time I make substantial edits on the apps file i back it up. Included are batch files for start, stop, backup and install the service, as well as how to set up the gui nssm presents when installing. Note the path field contains the full path where java exists, including the executable...\ javaw which cannot be seen to the right. My folder containing metabase.jar and the metabase.db.mv.db is in Program Files (x86)\POPReports and that's where i need to run any nssm commands from.




As I mentioned in the other post, by running Metabase with H2 as the application database you're playing right now with fire and there's a 100% probability you'll burn yourself

Please, do NOT USE h2 as a database other than for testing purposes. YOU WILL LOSE EVERYTHING in your Metabase instance as H2 is NOT a proper database. Please move to Postgres or MySQL for a proper and production ready application database.

the ctrl-c issue destroying the H2 as associated with running java as an executable. this issue disappeared once get it setup to run as a service with nssm.