Moving CDR and CEL from old to new

To help people searching, you can use these commands to export your CDR and CEL information from your old install to put into your new. Older versions could have asteriskuser instead of freepbxuser


mysqldump --skip-add-drop-table --no-create-db --no-create-info --complete-insert -u freepbxuser -p asteriskcdrdb cdr > cdr.sql
mysqldump --skip-add-drop-table --no-create-db --no-create-info --complete-insert -u freepbxuser -p asteriskcdrdb cel > cel.sql


mysql -u root asteriskcdrdb < /home/mhammett/cdr2.sql
mysql -u root asteriskcdrdb < /home/mhammett/cel2.sql

The above commands need the MySQL creds substituted for your system, which you can find in /etc/freepbx.conf, or if using the distro and logged in as root, can be simplified as:

Old PBX:

mysqldump --skip-add-drop-table --no-create-db --no-create-info --complete-insert asteriskcdrdb cdr > cdr.sql 
mysqldump --skip-add-drop-table --no-create-db --no-create-info --complete-insert asteriskcdrdb cel > cel.sql

Manually transfer the files to the new PBX, then import using:

mysql asteriskcdrdb < cdr.sql
mysql asteriskcdrdb < cel.sql

edit - more recently I’ve run into issues using the above method. I’ve since simplified it a bit:

on old:

mysqldump  asteriskcdrdb cel > cel.sql
mysqldump  asteriskcdrdb cdr > cdr.sql

on new:

mysql asteriskcdrdb < cel.sql
fwconsole ma install cel
mysql asteriskcdrdb < cdr.sql
fwconsole ma install cdr

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.