No, you should be able to migrate the database without clearing anything, if you did everything correctly. What's the error?
Thanks Anton, I'm using the code below to connect to the SQL database, this code works on the older version of traccar but for some reason as soon as I add this code to the config file traccar does not load.
The error showing in the log is this: Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@1f88dc4a (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://xx.xx.xx.xx/xxxxxxxxx?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>xxxxxxxxx</entry>
<entry key='database.password'>xxxxxxxxxx</entry>
What's the database wait_timeout
parameter?
Currently 600 seconds
It's strange as this code works on 6.12, so I assumed it may have been due to the database being populated
Try increasing it to 30 minutes.
It's working now, I created a new SQL database and the new traccar install populated the database and runs fine now.
If anyone else is having this issue, It seems that for some reason it didn't like migrating to an old database with the new install
I suspect it might have had to do with this:
Added missing index on positions table. It was only an issue if you installed version 4.0 or newer without upgrading from any earlier version. The index on device and time columns was missing, which was causing very slow reports. The issue is fixed now, but note that it might take a while to create an index, so be patient when you start server first time after upgrade.
If you have a backup of your old database, you could try to put it back, increase wait_timeout to something insane, and restart traccar twice. If that was the problem, restarting the first time should take a long time, but restarting the second time should be fast.
Since upgrading to 4.13 traccar crashes and will not load (also unable to stop the task), I am connecting to an external SQL server via the config, is it possible that I have to empty the old SQL database for the new install to load properly?