Page 1 of 1

Clear records from xml_cdr

Posted: Sat Nov 05, 2016 8:31 am
by ozeebrown
Hi. I have been using FusionPBX at ASW Market Place for few months now. My disk is just 8GB on a t2.micro The space is critical due to CDR information recorded on the database.

Question : How do I remove cdr recorded on the database?

Something like following would work for MYSQL

#!/bin/sh
/usr/bin/mysql -u root fusionpbx -e "DELETE FROM v_xml_cdr WHERE DATE(start_stamp) <= DATE(SUBDATE(NOW(),365))";

But we have SQLite database.

Thank you. Guy.

Re: Clear records from xml_cdr

Posted: Tue Nov 08, 2016 6:44 pm
by jsun
You would do the following for sqlite database. Let me know if that works.

Code: Select all

sudo su
sqlite3 /var/www/html/fusionpbx/secure/fusionpbx.db "DELETE FROM v_xml_cdr WHERE DATE(start_stamp) <= DATE(SUBDATE(NOW(),365))"

Re: Clear records from xml_cdr

Posted: Wed May 03, 2017 8:08 am
by ozeebrown
Hi,

Thank you for your previous reply.

My SQLITE fusionpbx.db is over 1TB.
I have followed your instructions today and DELETE FROM v_xml_cdr;

It deleted the call records (no old call records displayed in "Call Detailed Records" in FusionPBX).

But it made no changes to the size of the database. I can not explain why.

I was hoping if you could help me out with reducing the size of the Database.
My PBX is running on AWS, on a Fusionpbx from Netspectrum.

Thank you. Kind Regards, Guy.

Re: Clear records from xml_cdr

Posted: Thu May 04, 2017 5:57 am
by jsun
You would need to execute "vacuum" command. See more details at this link, http://stackoverflow.com/questions/2143 ... from-table.

Re: Clear records from xml_cdr

Posted: Mon May 08, 2017 12:11 am
by ozeebrown
Thank you very much. That fixed it.