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

CLI Tool for qeupgradehelper

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.1.6, 2.2.3
    • 2.2.2, 2.3
    • Questions
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      Moodle 1.9 or 2.0 site with quiz attempts.

      Place 2.1, 2.2 or master code in place - but do not run upgrade yet!
      Create admin/tool/qeupgradehelper/partialupgrade.php (2.1 path is local/qeupgradehelper/partialupgrade.php), with the code:

      <?php
      function tool_qeupgradehelper_get_quizzes_to_upgrade() {
          return array();
      }

      This will cause the question attempt upgrade to not execute.

      Run the Moodle system upgrade.

      now run (via command line):
      sudo -u www-data /usr/bin/php admin/tool/qeupgradehelper/cli/convert.php -h
      or (for 2.1)
      sudo -u www-data /usr/bin/php local/qeupgradehelper/cli/convert.php -h

      note that www-data is the user of the webprocess on your system - it may be something else, like httpd or apache, the path to php may also vary.

      From there you can try different flags, -t=x to process for x seconds (note it allows the current quiz to finish, so it will likely run longer than x seconds), -c=n to process n quizes, or --quiz=quizid to process quizid.

      -t and -c can be used together, the first to be reached causes a stop.

      No flags will cause the system to complete all remaining quizes.

      Show
      Moodle 1.9 or 2.0 site with quiz attempts. Place 2.1, 2.2 or master code in place - but do not run upgrade yet! Create admin/tool/qeupgradehelper/partialupgrade.php (2.1 path is local/qeupgradehelper/partialupgrade.php), with the code: <?php function tool_qeupgradehelper_get_quizzes_to_upgrade() { return array(); } This will cause the question attempt upgrade to not execute. Run the Moodle system upgrade. now run (via command line): sudo -u www-data /usr/bin/php admin/tool/qeupgradehelper/cli/convert.php -h or (for 2.1) sudo -u www-data /usr/bin/php local/qeupgradehelper/cli/convert.php -h note that www-data is the user of the webprocess on your system - it may be something else, like httpd or apache, the path to php may also vary. From there you can try different flags, -t=x to process for x seconds (note it allows the current quiz to finish, so it will likely run longer than x seconds), -c=n to process n quizes, or --quiz=quizid to process quizid. -t and -c can be used together, the first to be reached causes a stop. No flags will cause the system to complete all remaining quizes.

      We wrote a tool to execute qeupgradehelper, and it allows some options, like only upgrade quiz id x, upgrade x quizes, and run for x seconds.

      I feel this may be pretty helpful to other installs with large attempt upgrade, over the browser based upgrade.

            emerrill Eric Merrill
            emerrill Eric Merrill
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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