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

CLI Tool for qeupgradehelper

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerrill Eric Merrill
                Reporter:
                emerrill Eric Merrill
                Peer reviewer:
                Tim Hunt
                Integrator:
                Dan Poltawski
                Tester:
                Adrian Greeve
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12