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

Automated backups: Old backups are not deleted when file name is renamed from language string

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Ensure you have at least two language packs installed on the site and one course.
      2. Visit 'Courses' > 'Backups' > 'Automated backup setup'.
      3. Set the value 'Active' to 'Enabled'.
      4. Set the value 'Automated backup storage' to 'Course backup filearea and the specified directory'.
      5. Set the value 'Save to' to a writable directory.
      6. Set the value 'Keep' to 1.
      7. Save the form.
      8. Run the script admin/cli/automated_backups.php.
      9. Visit the restore area for the course and the specified directory and confirm there is now an automated backup there for the course.
      10. Visit 'Site administration' > 'Language' > 'Language settings' and change the setting 'Default language' to something else.
      11. Run the script admin/cli/automated_backups.php again.
      12. Visit the restore area for the course and the specified directory and check that there is only one backup for the course with a different starting word ('backup' in another language) and the older backup is gone.
      Show
      Ensure you have at least two language packs installed on the site and one course. Visit 'Courses' > 'Backups' > 'Automated backup setup'. Set the value 'Active' to 'Enabled'. Set the value 'Automated backup storage' to 'Course backup filearea and the specified directory'. Set the value 'Save to' to a writable directory. Set the value 'Keep' to 1. Save the form. Run the script admin/cli/automated_backups.php. Visit the restore area for the course and the specified directory and confirm there is now an automated backup there for the course. Visit 'Site administration' > 'Language' > 'Language settings' and change the setting 'Default language' to something else. Run the script admin/cli/automated_backups.php again. Visit the restore area for the course and the specified directory and check that there is only one backup for the course with a different starting word ('backup' in another language) and the older backup is gone.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-47601_master
    • Sprint:
      BACKEND Sprint 18

      Description

      Automated courses backups process do not delete old backups (backup_auto_keep config) when the file is renamed because of language translation (New feature in 2.6 ?).

      For example : Our environment is by default in French, so backup files were called "backup-moodle2-course-...". After updating language strings, backups were renamed to "sauvegarde-moodle2-course-...". Now, old backups with file name in English stays forever (See attachments).

      I dug the code and the commits and found out that the bug is possibly there since Moodle 2.0. Code for deleting old backups comes from the remove_excess_backups method created in task MDL-22184 (See http://git.moodle.org/gw?p=moodle.git;a=commitdiff;h=bac233d32666bf05dd001dce21c0e44537960c39).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Jan/15