Run the stored procedure to recover accounting data
To generate missing data in the accounting_event_detail
table, we have to run the kinton.UpdateAccounting()
procedure for the time that data is missing or deleted from the accounting_event_detail
table.
The steps to recover accounting data are:
On the Abiquo database, run the following query to get the last date with the accounting data:
SELECT MAX(startTime) FROM kinton_accounting.accounting_event_detail;
On the Abiquo API or Reporting server, deactivate the accounting cron job during your data recovery process. You can find this job at
/etc/cron.d/abiquo-accounting.cron
On your database server, at the command prompt, run the
UpdateAccounting
procedure multiple times using the following command. Replace the<root_pwd>
and<dbhost>
with your server values and replace the date2023-12-XX
with the date returned in step 1 above.for ((i=0;i<=$((($(date +%s)-$(date +%s -d '2023-12-XX'))/(60*60*24)));i++));do mysql -uroot -p<root_pwd> -h<dbhost> -e "CALL kinton.UpdateAccounting();"; done
Wait until the above command finishes because it may take some time to generate all the missing data
Activate the accounting cron job again at
/etc/cron.d/abiquo-accounting.cron
To update the billing data on your dashboards and check the recovery, in the Abiquo UI, edit an enterprise, and go to Billing, and run Generate billing
Â
Â
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved