Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-5204

UTF8 upgrade guide might lead to data loss

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Component/s: docs.moodle.org
    • Labels:
      None

      Description

      __

      https://docs.moodle.org/32/en/Converting_your_MySQL_database_to_UTF8

       

      The --add-drop-database shouldn't be in the data.sql, because the database should have been created by schema.sql (I think I stumled over this when I did the upgrade).

      Executing the data export after importing schema.sql (droping the database) on the same computer probably causes loss of all your data (if done on the same database).
      mysqldump -u$1 -p$2 -c -e --default-character-set=utf8mb4 --single-transaction --skip-set-charset --add-drop-database -B --no-create-info $3 > data.sql
       

      I think there should no "--add-drop-database" when exporting the data.sql and the data should be exported before trying to import anything.

       

      Another issues, which should probably be tried to be fixed:

      Another issue is that this guide is for converting from latin1. I already had utf8, but not utf8mb4. Just replacing latin1 by utf8 didn't help because there were some steps needed, because of some different table collatings in the old schema.

      I remember that there also were issues with the ROW_FORMAT during the first import attempt (but I can't remember what exactly had to be done).

      Sorry that I can't provide you the sed statements I needed, because I did this some time ago (console history lost), but I wanted to warn you about the --add-drop-database issues.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              moodlebugreporter Himmelbauer
              Participants:
              Component watchers:
              Helen Foster
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: