Migrate old H2 1.4 to new 2.0

samlink2 years ago

Hi everyone, I tried migrating from 4.14 to 5.3 but I'm getting an error because of the old H2 files. I was wondering if there is any tool that can migrate H2 DB 1.4 to the new 2.0 used on newer version of Traccar. I have only 1 gps tracked for personal use, I don't have much data and I'm ok sticking with H2 for now.

Anton Tananaev2 years ago
samlink2 years ago

I tried, but I got an error just on the first line of the SQL I generated:

Sequence "SYSTEM_SEQUENCE_20BF9A9E_71CB_49A8_9D1F_5F156BEE0623" already exists; SQL statement:
CREATE SEQUENCE "PUBLIC"."SYSTEM_SEQUENCE_20BF9A9E_71CB_49A8_9D1F_5F156BEE0623" START WITH 3 BELONGS_TO_TABLE [90035-206] 90035/90035
Anton Tananaev2 years ago

That's from the tool (H2MigrationTool)?

samlink2 years ago

No, I used the SCRIPT/RUNSCRIPT method. Maybe I have exported to much? I did SCRIPT TO "filename.sql" without other options.
Can I delete and recreate an empty DB and then importing into it with my sql file generated before?

Anton Tananaev2 years ago

Try the tool.

samlink2 years ago

For some reason I kept getting java errors with that tool.
However deleting the DB and recreating it with the sql file did the job.