Error to update to 4.15

nicola10 months ago


I tried to update to the latest version from the file "traccar-other-4.15.zipper" but when I try to start the server an exception is thrown:

 Exception in thread "main" java.lang.RuntimeException:                                                                                                                           com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initia                                                                                                                          lize pool: General error: "The write format 1 is smaller than the supported form                                                                                                                          at 2 [2.0.206/5]" [50000-206]
        at org.traccar.Main.main(
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed                                                                                                                           to initialize pool: General error: "The write format 1 is smaller than the supp                                                                                                                          orted format 2 [2.0.206/5]" [50000-206]
        at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(Hi                                                                                                                
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(
        at com.zaxxer.hikari.pool.HikariPool.<init>(
        at com.zaxxer.hikari.HikariDataSource.<init>(
        at org.traccar.database.DataManager.initDatabase(
        at org.traccar.database.DataManager.<init>(
        at org.traccar.Context.init(
        ... 1 more
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "The write f                                                                                                                          ormat 1 is smaller than the supported format 2 [2.0.206/5]" [50000-206]
        at org.h2.message.DbException.getJdbcSQLException(
        at org.h2.message.DbException.getJdbcSQLException(
        at org.h2.message.DbException.get(
        at org.h2.mvstore.db.Store.convertMVStoreException(
        at org.h2.mvstore.db.Store.<init>(
        at org.h2.engine.Database.<init>(
        at org.h2.engine.Engine.openSession(
        at org.h2.engine.Engine.openSession(
        at org.h2.engine.Engine.createSession(
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav                                                                                                                          a:338)
        at org.h2.jdbc.JdbcConnection.<init>(
        at org.h2.Driver.connect(
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSourc                                                                                                                
        at com.zaxxer.hikari.pool.PoolBase.newConnection(
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(                                                                                                                          )
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(
        ... 7 more
Caused by: org.h2.mvstore.MVStoreException: The write format 1 is smaller than t                                                                                                                          he supported format 2 [2.0.206/5]
        at org.h2.mvstore.DataUtils.newMVStoreException(
        at org.h2.mvstore.MVStore.getUnsupportedWriteFormatException(MVStore.jav                                                                                                                          a:1059)
        at org.h2.mvstore.MVStore.readStoreHeader(
        at org.h2.mvstore.MVStore.<init>(
        at org.h2.mvstore.MVStore$
        at org.h2.mvstore.db.Store.<init>(
        ... 19 more
catruchos10 months ago

I had the same problem It looks like that former version of h2 traccar used was 1.4.200 and the new one is 2.0.206

and after a lot of try and error I success to install the new version and restore my old h2 database (1.4.200) to the new h2 version (2.0.206) that is the one used by traccar 4.15.

I am not expert at all, and It might be something wrong, but It worked for me.

You need java installed

First of all, before upgrade, you have to make a copy of the old database file, in my case It was in:

Then I downloaded and extracted the h2-1.4.200.jar file from H2 archive downloads version 1.4.200 platform independent zip
I did the same with the h2-2.0.206.jar file from from H2 archive downloads version 1.4.206 platform independent zip

I put them both on the same folder with the backup copy of the database, in my case in C:\temp
After that I did a database backup from old database following the instructions from This link
The command I use was
java -cp c:\temp\h2-1.4.200.jar -url jdbc:h2:c:\temp\database -user sa -script -options compression zip
This creates a zip file named with a dump of the database

After that I restore the database in 2.0.206 version with this command

java -cp c:\temp\h2-2.0.206.jar -url jdbc:h2:c:\temp\database_new -user sa -script -options compression zip

After that the database will be created with the name

You have to copy to the database folder on your traccar installation
Stop traccar, delete old version of the file and rename the file database_new_mv.db to

Start traccar, and It should work with all the old data

HJvD10 months ago

Had the same db-problem, and also was puzzled how to convert. Beautiful step-by-step instruction catruchos! Was a bit confused that the file was not shown in the temp-folder, but that didn't affect the end result. Thank you for writing this down!

nicola10 months ago

Thanks catruchos for the detailed instructions.
I was able to update!

MT10 months ago

catruchos you are a star ! had a nightmare yesterday trying to get traccar to start after the upgrade, your steps worked first time ! thank you : )

Bohdan10 months ago

Thank you!! This should really have been in the release notes so we know to upgrade db prior to upgrade

Jeremie P10 months ago

You can do it directly from unix part too...

stop traccar

systemctl stop traccar

create temp directory for fix

mkdir /opt/FIXH2 ; cd /opt/FIXH2

mv h2 ./h2.2019
mv h2 ./h2.2022

find ./ -name "*.jar"


copy old database file (to fix)

root@DID-Traccar:/opt/FIXH2# cp -p /opt/traccar.4.13/data/ /opt/FIXH2

export database with (1.4)

root@DID-Traccar:/opt/FIXH2# java -cp ./h2.2019/bin/h2-1.4.200.jar -url jdbc:h2:./database -user sa -script -options compression zip

export database from to (2.0) with

root@DID-Traccar:/opt/FIXH2# java -cp ./h2.2022/bin/h2-2.0.206.jar -url jdbc:h2:./database_new -user sa -script -options compression zip

restore new database file to current traccar data :

root@DID-Traccar:/opt/FIXH2# cp ./ /opt/traccar/data/

restart traccar

systemctl start traccar

amibumping10 months ago

@Jeremie P this worked perfect!

Thank you

Just to help for copying:

systemctl stop traccar
mkdir /opt/FIXH2
cd /opt/FIXH2
mv h2 ./h2.2019
mv h2 ./h2.2022
find ./ -name "*.jar"
cp -p /opt/traccar.4.13/data/ /opt/FIXH2
java -cp ./h2.2019/bin/h2-1.4.200.jar -url jdbc:h2:./database -user sa -script -options compression zip
java -cp ./h2.2022/bin/h2-2.0.206.jar -url jdbc:h2:./database_new -user sa -script -options compression zip
cp ./ /opt/traccar/data/
systemctl start traccar
Julian L10 months ago

Thank you for the linux (and windows) walk through, very helpful.

I had an error extracting the data. This is the error:

org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Unable to read the page at position ...

I am upgrading from Traccar 3.4. I have fixed the error above by using an older version of H2 tools (1.4), specifically this version:

The database is then successfully exported.

Avant21 days ago

Thanks @amibumping - the summary worked a treat