Check deletePositions
and deleteEvents
SQL scripts in the config file.
DO I NEED TO USE MYSQL WORKBENCH OR ADDING THIS LINE TO THE TRACCAR.XML FILE
<entry key='database.positionsHistoryDays'>90</entry>
CAN YOU TELL ME THE STEP TO DO IT PLEASE. IM USING TRACCAR 3.10. AND 2 YEARS OF DATA IN MYSQL. THANKS
Please don't write in all-caps.
do i need to use mysql workbench or adding this line to the traccar.xml file
<entry key='database.positionsHistoryDays'>90</entry>
can you help me with the steps to do it please. im using traccar 3.10 and 2 years of data in mysql. thanks
You can use configuration parameter, but the request might timeout because you have a lot of data. I'm also not sure if it's available in version 3.10.
If it does timeout, then the solution is to do it in small steps; start at for instance 600 days, then 550, 500 etc, until you are down at your 90 days.
<entry key='database.positionsHistoryDays'>90</entry>
Is It avalable for the current version ?
No, it's not. We have a different recommendation now due to the issue I mentioned above:
Is there an equivlient to https://www.traccar.org/clear-history/ if using the H2 database?
No, but you should never use H2 for production.
Hi Anton,
Within tc_events there is no column name called eventTime.
+---------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| type | varchar(128) | NO | | NULL | |
| servertime | timestamp | NO | | NULL | |
| deviceid | int | YES | MUL | NULL | |
| positionid | int | YES | | NULL | |
| geofenceid | int | YES | | NULL | |
| attributes | varchar(4000) | YES | | NULL | |
| maintenanceid | int | YES | | NULL | |
+---------------+---------------+------+-----+---------+----------------+
It means you are not using the latest release or you haven't upgraded correctly.
Why can't h2 be used in production?
Because it doesn't scale well, there's no good tooling around it and you also might lose all the data due to corruption. There's just no single good reason to use it.
hello, im using traccar 3.10 with more then 100 gps and mysql 5.6. system work perfect no problems since 1 year. but i need to delete old positions and keep only the last 3 months. reports are taking to much time to load.
can some one help me with the mysql script or how to do it.
thanks