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

Course backups from versions earlier than 3.11.7 lose format options on restore

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-74698_401
    • Hide

      Prepare an Old-Format Backup File for Use in Testing (using a Moodle site with version 3.11.6 or lower, or 4.0.0)

      1. Add a new course with "Format" set to "Topics" or "Weekly", and "Course layout" set differently from the site default on the site you will be restoring the backup to (typically the site default would be "Show all sections on one page", so this setting should be changed to "Show one section per page").
      2. Back up the course.
      3. Download the course backup file.

      Test Restoring an Old-Format Backup File (in Current Moodle)

      1. Restore the saved course backup file as a new course.
      2. Edit the course settings.
      3. Verify "Course layout" should be set as it was in the backed up course (typically "Show one section per page").

      Test Restoring a Course in One Format over a Course in Another Format (in Current Moodle)

      1. Add a first new course with "Format" set to "Topics", "Hidden sections" set to "Hidden sections are shown as not available", and "Course layout" set to "Show all sections on one page".
      2. Add a second new course with "Format" set to "Weekly", "Hidden sections" set to "Hidden sections are completely invisible", and "Course layout" set to "Show one section per page".
      3. Back up the second course.
      4. Restore the course backup. In the "Destination" stage, under "Restore into an existing course" select the first course and "Delete the contents of the existing course and then restore". In the "Schema" stage, set "Overwrite course configuration" to "Yes", and for both "Course name" and "Course short name" untick "Overwrite".
      5. Edit the first course's settings.
      6. Verify "Hidden sections" should be set to "Hidden sections are completely invisible", and "Course layout" should be set to "Show one section per page".

      Show
      Prepare an Old-Format Backup File for Use in Testing (using a Moodle site with version 3.11.6 or lower, or 4.0.0) 1. Add a new course with "Format" set to "Topics" or "Weekly", and "Course layout" set differently from the site default on the site you will be restoring the backup to (typically the site default would be "Show all sections on one page", so this setting should be changed to "Show one section per page"). 2. Back up the course. 3. Download the course backup file. Test Restoring an Old-Format Backup File (in Current Moodle) 1. Restore the saved course backup file as a new course. 2. Edit the course settings. 3. Verify "Course layout" should be set as it was in the backed up course (typically "Show one section per page"). Test Restoring a Course in One Format over a Course in Another Format (in Current Moodle) 1. Add a first new course with "Format" set to "Topics", "Hidden sections" set to "Hidden sections are shown as not available", and "Course layout" set to "Show all sections on one page". 2. Add a second new course with "Format" set to "Weekly", "Hidden sections" set to "Hidden sections are completely invisible", and "Course layout" set to "Show one section per page". 3. Back up the second course. 4. Restore the course backup. In the "Destination" stage, under "Restore into an existing course" select the first course and "Delete the contents of the existing course and then restore". In the "Schema" stage, set "Overwrite course configuration" to "Yes", and for both "Course name" and "Course short name" untick "Overwrite". 5. Edit the first course's settings. 6. Verify "Hidden sections" should be set to "Hidden sections are completely invisible", and "Course layout" should be set to "Show one section per page".

      A backup taken in a version before 3.11.7 or 4.0.1 (where MDL-65478 was integrated) will have its course format settings reverted to defaults when restored into a 3.11.7 or 4.0.1 site. This is a consequence of the MDL-65478 change not accounting for earlier version backups when it changed the storage strategy for format options.

      Additionally, a second related fault exists with course format options being restored against the wrong format type because the format is not used as a condition of the record existence check.

      To reproduce the loss of format settings old-to-new:

      1. Create a course in a 3.11.6 site with weeks/topics format and change the 'Hidden sections' and 'Course layout' settings to values other than the site defaults (typically that would mean setting 'Hidden sections are completely invisible' and 'Show one section per page').
      2. Back up the course.
      3. In a 3.11.7 site, restore the backup.
      4. Edit the restored course settings and observe the 'Hidden sections' and 'Course layout' settings are back to the site defaults (typically 'Hidden sections are shown in collapsed form' and 'Show all sections on one page')

      To reproduce restoration of course format options against the wrong format type:

      1. Create a course using Topics format and set its 'Hidden sections' option to '.. are shown as not available' and 'Course layout' to 'Show all sections on one page'.
      2. Create a second course using Weekly format and set 'Hidden sections' to '.. completely invisible' and 'Course layout' to 'Show one section per page'.
      3. Back up the second course and restore it over the first course. i.e. Restore into an existing course → Delete the contents of the existing course and then restore, choose to overwrite course configuration but not the names.
      4. Compare the first and second courses and observe they don't have the expected matching course format settings.

        1. 400_overide_format.gif
          400_overide_format.gif
          289 kB
        2. master_override_format.gif
          master_override_format.gif
          1.46 MB
        3. master_restore_old.gif
          master_restore_old.gif
          1.53 MB
        4. 400_restore_old.gif
          400_restore_old.gif
          1.78 MB
        5. 401_restore_old.gif
          401_restore_old.gif
          2.22 MB
        6. 401_override_format.gif
          401_override_format.gif
          2.16 MB

            jonof Jonathon Fowler
            jonof Jonathon Fowler
            Dan Marsden Dan Marsden
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 36 minutes
                1h 36m

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