Mandatory Update Commands to Fix Reporting Tables After Upgrade.

Mandatory Update Commands to Fix Reporting Tables After Upgrade.

Background

If you have backed up and restored a server that was previously using scopserv-telephony25 version 7.40.0.0.20230227 or older, then you will have to manually execute an update script to restructure CEL data and CDR tables after completing your restore.

Symptoms

ScopSTATS reports with no information, and the asterisk console could print database errors for every call.

Root Cause

Changes to report tables were implemented to consolidate CEL and CDR data for multiple reports (example: using CEL data to update ACD logs with SIP call transfer data).
Implementation started with this version of scopserv-telephony25 and additional enhancements were committed to newer releases.

7.40.0.0.20230227


If you are backing up and restoring an old server or installing/updating with newer packages and reports look to be missing then execute these commands:

rm all .lock file in ~scopserv/telephony/scripts/upgrade/ directory using:
rm -f /var/www/scopserv/telephony/scripts/upgrade/*.lock

Then run the update script:
php /var/www/scopserv/telephony/scripts/update


Caveats


There could be years worth of tables that require updating so the process can take anywhere from minutes to hours. Do not interrupt the process manually once started.