Port H2 instance to MySQL

Jack4 years ago

Hello,

I want to upgrade my Traccar instance from H2 database to MySQL taking with me users and data (database?).
Do you think it is possible without major issues? What would be your suggested operation checklist?

I've already dumped the H2 database to SQL file using the following line

$ java -cp h2-1.4.197.jar org.h2.tools.RunScript -url "jdbc:h2:file:./database" -user "myuser" -password "mypass" -script query.sql -showResults

where query.sql is:

SCRIPT TO 'db-dump.sql'

I successfully obtain a 6MB file (the .db in input is 20MB, I'm quite surprised to see the dump smaller than the database)

Thank you