I have not tested this guide on FreePBX 15, nor do I intend to.
68GB is significantly larger than any system I have tested against.
I would first confirm what is consuming the space before assuming the majority of it is CDR/CEL data.
du -sh /var/lib/mysql/*
16K /var/lib/mysql/aria_log.00000001
4.0K /var/lib/mysql/aria_log_control
5.4M /var/lib/mysql/asterisk
201M /var/lib/mysql/asteriskcdrdb
3.4G /var/lib/mysql/ibdata1
5.0M /var/lib/mysql/ib_logfile0
5.0M /var/lib/mysql/ib_logfile1
1004K /var/lib/mysql/mysql
0 /var/lib/mysql/mysql.sock
212K /var/lib/mysql/performance_schema
0 /var/lib/mysql/test
du -sh /var/lib/mysql/asteriskcdrdb/*
20K /var/lib/mysql/asteriskcdrdb/cdr.frm
4.0K /var/lib/mysql/asteriskcdrdb/cdr.TRG
4.0K /var/lib/mysql/asteriskcdrdb/cdrTrigger.TRN
20K /var/lib/mysql/asteriskcdrdb/cel.frm
4.0K /var/lib/mysql/asteriskcdrdb/db.opt
12K /var/lib/mysql/asteriskcdrdb/queuelog.frm
20K /var/lib/mysql/asteriskcdrdb/transient_cdr.frm
137M /var/lib/mysql/asteriskcdrdb/transient_cdr.MYD
64M /var/lib/mysql/asteriskcdrdb/transient_cdr.MYI
If the majority of that space is CDR/CEL data, I recommend pruning much smaller date ranges than the before 1 July 2023 example used in the guide below.
For example, I have just tested it again on v16 with the following data set:
±--------------+
| cdr_to_delete |
±--------------+
| 470194 |
±--------------+
±--------------+
| cel_to_delete |
±--------------+
| 3522574 |
±--------------+
Ensure you have a recent backup or VM snapshot before making any changes. This sort of pruning is not routine maintenance. If possible, test the procedure on a dev system first. Also make sure you have plenty of free disk space available before starting. The backup and restore test requires additional temporary database storage. One of my test runs crashed because there wasn’t enough free space, and recovering it wasn’t straightforward. If the filesystem runs out of space, the restore will fail part-way through and require manual recovery.
Before pruning the database, it’s worth checking whether other large items (such as call recordings or old log files) can be removed instead. If the database itself is not the primary consumer of disk space, pruning CDR/CEL records may not significantly reduce disk usage.
https://support.20tele.com/index.php?rp=/knowledgebase/21/Pruning-CDR-Reports---Delete-CDRorCEL-Records.html