CDR detail in the DB

Voipy

Member
Feb 5, 2026
44
1
8
56
Hi

On our Fusion set up we periodically run a script to remove most of the information from the CDRs. There is huge amount of info which is really useful when troubleshooting, but there is no need to keep this after a few days. We do need to keep the CDRs for 5 years so we want them as compact as possible.

Is there a need to do this on FS PBX as well, bearing in mind the 5 years, or does it store far less info to begin with?
 
I suggest you continue to run your script and perform a vacuum periodically. It's not enough to just delete records
 
Hi - thanks. Autovacuum should be running though so no need to to perform this manually I think?
 
Last edited:
How do I run vacuum or autovacuum?
I'm not sure how to get access to the database to run these commands.
I need to compact the DB
 
Hi

Log into postgres - the username will be fusionpbx. If you don't know the pass, it will be in /etc/fusionpbx/config.conf

that will get you in. I am far from well versed in postgres stuff but remember that a vacuum full will lock the tables, so that you should do when you have no traffic. A normal vacuum does not, but will not release the space to the OS, only make it available to Postgres again.
 
I appreciate the quick response, but I am a total newbie with this issue.

How do I get to the login into postgres?
I'm sure that once I get to log into postgres, I can figure it out.
 
If by getting to "a login" you mean a gui page - there isn't one. For that you would need something like phpmyadmin.

from the cli - something like:

psql --host=127.0.0.1 --username=fusionpbx

It will ask for the password - give that, and you're in. From there you will have to run the commands. A google may be best here but be careful, you're working on the live DB so you may want to make sure you have a backup in case you do something wrong.