Delete user data in compliance with GDPR
The TableGarbageCollection task was introduced with TYPO3 4.6, many years before the introduction of the GDPR. This scheduler task can be used to delete old data records from selected database tables. For a long time, this task was only used for the sys_log system table, because without deleting old data, this table could become many gigabytes in size - and thus impair performance.
In times of GDPR, this task is receiving more attention again. Recently, the sys_history table and, if indexed_search has been activated, the index_stat_search table have been added.
However, the scheduler task can also be extended with additional tables for your own or third-party extensions (via a SitePackage) using a hook.
Powermail has been using this hook since September 2017 and adds the tables tx_powermail_domain_model_answer and tx_powermail_domain_model_mail in this way. These tables contain personal data that was entered via Powermail forms. For data protection reasons, this data should be automatically deleted after 30 days, for example.
You currently have to create a separate task for each individual table. On the one hand, this is inconvenient, but on the other hand, you can specify individually for each table how old the data records must be before they are deleted.
For custom extensions that store personal data, the database table can be included in the scheduler task according to the following scheme in the ext_localconf.php file:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['my_table_name'] = [
'dateField' => 'tstamp',
'expirePeriod' => 30
];
The dateField is used to specify which column of the table is to be used to find out which data records are older than the specification from expirePeriod. Interestingly, when a table is changed in the task, the default value for expirePeriod from this hook configuration is also automatically pre-filled in the task.
If no individual configuration is required for the tables, the All tables checkbox can be activated. In this case, the expirePeriod can no longer be specified individually for each table. Instead, the default value from expirePeriod is used.
This page contains automatically translated content.