h2 to mysql

darkell5 years ago

Hello,

what is the best migration method from default h2 db to mysql other than starting from scratch? is there a conversion script available or simply export/import from within the app?

Thank you,
Dariusz

Anders Yuran5 years ago
darkell5 years ago

I tried it, trail version alters the database with lots of TRIAL watermarking everywhere.

I have managed to migrate by using squirrelsql
http://www.squirrelsql.org/

darkell5 years ago

for those who are using mysql, are you also seeing this in your db logs?

2020-04-30  8:02:44 24 [Warning] Aborted connection 24 to db: 'traccardb' user: 'traccardb' host: '192.168.254.2' (Got an error reading communication packets)
2020-04-30  8:02:44 28 [Warning] Aborted connection 28 to db: 'traccardb' user: 'traccardb' host: '192.168.254.2' (Got an error reading communication packets)
Anton Tananaev5 years ago

I would recommend using local database to avoid network issues.

darkell5 years ago

@Anton: this is a 10Gbps private link between DB server and App server.. no other app connected to mysql is giving me those. but thanks.

any other thoughts?

I am currently using these timers/values in mysql config
connect_timeout = 600
net_read_timeout = 600
net_write_timeout = 600
max_allowed_packet = 512M
wait_timeout = 28800

darkell
Could you give me an idea of how you created it.
Tables are different from MySQL and H2

MySql x H2

Anton Tananaev5 years ago

Tables are the same. Sounds like you just have different versions of Traccar.

There really are two different versions of Traccar.
I am updated and taking the opportunity to migrate the database.
The update documentation says the following:

  1. Make a database backup
  2. Backup your config file (if modified)
  3. Remove old version of Traccar
  4. Install new version of Traccar
  5. Restore config file (if applicable)
  6. Start Traccar servisse

What do you understand that the BD structure remains the same, what would be the correct way to do the migration?

Anton Tananaev5 years ago

Are you trying to upgrade Traccar and migrate from one database engine to another at the same time? I would recommend doing it step by step.

ghosty4 years ago

Hi darkell, any chance you can share the procedure you've done for the db migration?

If so, email me with my [removed].

Thanks!