DB query stopped working after upgrading from 2.5.x to 2.7.x

Re: DB query stopped working after upgrading from 2.5.x to 2.7.x

by Judy Hsu -
Number of replies: 1
Thanks Neill! You the man!

OK quick question. Let's say that I just enabled the legacy logging system (mdl_log). Would 2.7 try to log into both mdl_log (old) and the logstore_standard_log (new) at the same time? Or, would it just totally stop logging into the logstore_standard_log table, and just using mdl_log??

I did the 2.7 upgrade about 2 months ago. Does this mean that if we want to continue to use these old queries (that use mdl_log), there is no way that we can retrieve those data by using the old queries, and really have to rewrite these queries? How easy/hard would it be to rewrite this query so that we can capture the data between two months ago and now?

Also at high level could you please highlight some of the differences (structure-wise) between the old mdl_log and the new mdl_logstore_standard_log tables? Thanks a million!!
In reply to Judy Hsu

Re: DB query stopped working after upgrading from 2.5.x to 2.7.x

by Stuart Mealor -

If you have the logstore_standard_log (new) running, AND also the option to log to mdl_log (the legacy option) then Moodle will log events to both (unless you specifically deselect the standard logging option).

Using both could have a performance impact on your site - so it's worth monitoring that.

If you have logging set to go to mdl_log as well, then your old queries that referred to the mdl_log table will likely work again. However, you will be missing any data in the mdl_log table since you upgraded, and started using the logstore_standard_log only.

You can see the data that is being logged in logstore_standard_log here:
https://docs.moodle.org/27/en/Events_list_report

To actually see the data, and develop a better understanding of what is being captured in that table, then it's worth looking at the table data e.g. SELECT * FROM logstore_standard_log to see what's there. Then you can see which columns, and what values within columns, can be queried smile

In terms of re-writing, well it depends on how complex the queries were, and whether the same data is actually being logged in 2.7, as it was in 2.5.  It would be worth comparing the two tables side by side so you can see the differences, and in some cases make since changes to the table and columns used in the original query.

Average of ratings: Useful (1)