Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70536

Create a CLI script to reset user dashboards

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • MDL-70536-reset-page-cli
    • Hide
      1. Run the attached test script which generate a bunch of test dashboards so we can reset them (run it for as long as you want, you can kill it at any point):

        php MDL-70536-dashboard-generator.php
        

      2. Open a database shell and run the following statement and verify the result is ~10000 (Exact number is not important).

        SELECT COUNT(*) FROM mdl_my_pages;
        

      3. Run the new cli script

        php admin/cli/dashboard_reset.php
        

      4. Confirm it shows help.
      5. Actually run it now:

        php admin/cli/dashboard_reset.php -e
        

      6. Confirm you get a nice progress bar showing progress
      7. In the DB shell, run the same SELECT again
      8. Confirm the value is ~10,000 smaller (there may be other pages not touched in this table).
      9. Repeat steps 1-2.
      10. Run the script again (step 5), but this time in non ttl mode:

        php admin/cli/dashboard_reset.php -e | cat -v
        

      11. Confirm you still get a simpler but dynamic progress bar
      12. Repeat steps 7-8.
      Show
      Run the attached test script which generate a bunch of test dashboards so we can reset them (run it for as long as you want, you can kill it at any point): php MDL-70536-dashboard-generator.php Open a database shell and run the following statement and verify the result is ~10000 (Exact number is not important). SELECT COUNT (*) FROM mdl_my_pages; Run the new cli script php admin /cli/dashboard_reset .php Confirm it shows help. Actually run it now: php admin /cli/dashboard_reset .php -e Confirm you get a nice progress bar showing progress In the DB shell, run the same SELECT again Confirm the value is ~10,000 smaller (there may be other pages not touched in this table). Repeat steps 1-2. Run the script again (step 5), but this time in non ttl mode: php admin /cli/dashboard_reset .php -e | cat - v Confirm  you still get a simpler but dynamic progress bar Repeat steps 7-8.

      Our moodle instance has 100,000+ users. It is not possible to reset dashboards from the GUI. This should be a cli script. We just upgraded to 3.9. It has been years since we have ever seen the GUI script to reset dashboards run to completion (it always times out), but it is especially a problem now with the update to 3.9 and all the great new dashboard blocks.

            brendanheywood Brendan Heywood
            dsoini Diane Soini
            Peter Burnett Peter Burnett
            Victor Déniz Falcón Victor Déniz Falcón
            Janelle Barcega Janelle Barcega
            Votes:
            4 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 30 minutes
                3h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.