Moodle
  1. Moodle
  2. MDL-34086

META: Increase robustness of upgrade from 1.9 to 2.2

    Details

    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE

      Description

      Use this META bug to group and prioritise problems found in the 1.9 -> 2.2 upgrade.

      For large sites, please use the command-line interface (CLI).
      http://docs.moodle.org/22/en/Administration_via_command_line#Upgrading_via_command_line

      All fixes here should be ported to 2.2.x only.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Dan Poltawski added a comment -

            Really I think we should be able to do something like this in xmldb:
            http://docs.moodle.org/22/en/Verify_Database_Schema

            Show
            Dan Poltawski added a comment - Really I think we should be able to do something like this in xmldb: http://docs.moodle.org/22/en/Verify_Database_Schema
            Hide
            Dan Poltawski added a comment - - edited

            From http://moodle.org/mod/forum/discuss.php?d=205367 - some work someone had to do:

            ALTER TABLE mdl_user MODIFY COLUMN lastip VARCHAR(45) NOT NULL DEFAULT '';
            ALTER TABLE mdl_post MODIFY COLUMN uniquehash VARCHAR(255) NOT NULL DEFAULT '';
            ALTER TABLE mdl_resource MODIFY COLUMN reference VARCHAR(255) NOT NULL DEFAULT '';
            UPDATE mdl_user SET lastip = '0.0.0.0' WHERE lastip IS NULL;
            UPDATE mdl_user SET city = 'unknown' WHERE city IS NULL;
            ALTER TABLE mdl_modules ALTER COLUMN search SET DEFAULT 'default';
            

            FWIW, I have also had to change all of those fields apart form mdl_post and mdl_modules on a site i've upgraded. This must be fairly widespread.

            Show
            Dan Poltawski added a comment - - edited From http://moodle.org/mod/forum/discuss.php?d=205367 - some work someone had to do: ALTER TABLE mdl_user MODIFY COLUMN lastip VARCHAR(45) NOT NULL DEFAULT ''; ALTER TABLE mdl_post MODIFY COLUMN uniquehash VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE mdl_resource MODIFY COLUMN reference VARCHAR(255) NOT NULL DEFAULT ''; UPDATE mdl_user SET lastip = '0.0.0.0' WHERE lastip IS NULL; UPDATE mdl_user SET city = 'unknown' WHERE city IS NULL; ALTER TABLE mdl_modules ALTER COLUMN search SET DEFAULT 'default'; FWIW, I have also had to change all of those fields apart form mdl_post and mdl_modules on a site i've upgraded. This must be fairly widespread.
            Hide
            Martin Dougiamas added a comment -

            How about this one about collations? http://moodle.org/mod/forum/discuss.php?d=206607

            ELECT CONCAT('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') as stmt
            FROM `information_schema`.`TABLES` t
            WHERE 1
            AND t.`TABLE_SCHEMA` = 'moodledb'
            ORDER BY 1 ;
             
            and
             
            ALTER TABLE `mdl_course` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
             
            ALTER TABLE `mdl_context` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
             
            ALTER TABLE `mdl_role_assignments` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
             
            ALTER TABLE `mdl_enrol` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
            

            Show
            Martin Dougiamas added a comment - How about this one about collations? http://moodle.org/mod/forum/discuss.php?d=206607 ELECT CONCAT('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;') as stmt FROM `information_schema`.`TABLES` t WHERE 1 AND t.`TABLE_SCHEMA` = 'moodledb' ORDER BY 1 ;   and   ALTER TABLE `mdl_course` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;   ALTER TABLE `mdl_context` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;   ALTER TABLE `mdl_role_assignments` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;   ALTER TABLE `mdl_enrol` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
            Hide
            Dan Poltawski added a comment -

            Martin: pretty sure that is nothing to do with us, just mysql environment settings.

            Show
            Dan Poltawski added a comment - Martin: pretty sure that is nothing to do with us, just mysql environment settings.
            Hide
            Dan Poltawski added a comment -

            Please ignore my above comment. Petr has come up with a solution for this in MDL-34271.

            Show
            Dan Poltawski added a comment - Please ignore my above comment. Petr has come up with a solution for this in MDL-34271 .

              People

              • Votes:
                8 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: