Traccar TimescaleDB old positions get deleted

fts a day ago

Hi,

I tried out the latest Traccar 6.11.1 with a TimescaleDB. I successfully migrated my data from an older Traccar 5.4 installation with Postgres 13 database to a new Docker based Traccar installation.
The migration of the database from old format to newest format including TimescaleDB features went through without major issues.

But afterward I realized that process removed most of my older data. I found out that Traccar is configuring TimescaleDB with a 1 year retention policy by default:

> psql -U traccar -d traccar -c \ > "SELECT job_id, proc_name, schedule_interval, config > FROM timescaledb_information.jobs > ORDER BY job_id;" job_id | proc_name | schedule_interval | config 
--------+-----------------------------------+-------------------+---------------------------------------------------------------------------------------- 
1 | policy_telemetry | 24:00:00 | 
3 | policy_job_stat_history_retention | 06:00:00 | {"drop_after": "1 month", "max_failures_per_job": 1000, "max_successes_per_job": 1000} 
1000 | policy_retention | 1 day | {"drop_after": "1 year", "hypertable_id": 3} 
1001 | policy_retention | 1 day | {"drop_after": "1 year", "hypertable_id": 1} 
1002 | policy_retention | 1 day | {"drop_after": "1 year", "hypertable_id": 2} (5 rows)

I think a 1 year retention policy should not be the default, but keeping all data should be the default as before.
Enabling retention policy should be an option that the users can activate if they wish.

Best regards

Anton Tananaev a day ago

Let's see what other people think, but in my experience 1 year (or lower) is the most common value people want to use.