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

Automated backup : Do not backup unused courses (newly created and empty)

    XMLWordPrintable

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide
      1. Go to "Site administration > Courses > Backups > Automated backup setup" and set Active dropdown list to Manual
      • Testing of "Skipping Course (Not modified since X days)"
      1. Go to "Site administration > Courses > Backups > Automated backup setup" and select "3 days" in "Skip courses not modified since previous backup"
      2. Create a new course that is not hidden
      3. Run file admin/cli/automated_backups.php from cli (php admin/cli/automated_backups.php).
        -> You should see in the output that the course is skipped with message "Skipping Course name (Not modified since 3 days)"
      4. Go see in the restore page of the course that the backup is not there.
      5. Modifiy the course by adding any resources or activities (File, folders, assignment, forum...)
      6. Run file admin/cli/automated_backups.php from cli (php admin/cli/automated_backups.php).
        -> You should see in the output that the modified course is backed up.
      7. Go see in the restore page of the course that the backup is there.
      8. Directly in the database, change the timemodified and the logs of the course to greater than 3 days.
      9. Run file admin/cli/automated_backups.php from cli again.
        -> You should see in the output that the modified course is skipped with message "Skipping Course name (Not modified since 3 days)"
      10. Go see in the restore page of each courses that the backup hasn't changed (time).
      • Testing of "Skipping Course (Not modified since previous backup process)"
      1. Go to "Site administration > Courses > Backups > Automated backup setup" and check "Skip courses not modified since previous backup" and select "never" in "Skip courses not modified since previous backup"
      2. Create a new course that is not hidden
      3. Run file admin/cli/automated_backups.php from cli (php admin/cli/automated_backups.php).
        -> You should see in the output that the course is skipped with message "Skipping Course name (Not modified since previous backup process)"
      4. Go see in the restore page of the course that the backup is not there.
      5. Modifiy the course by adding any resouces or activities (File, folders, assignment, forum...)
      6. Run file admin/cli/automated_backups.php from cli again.
        -> You should see in the output that the course is backed up.
      7. Go see in the restore page of the course that the backup is there.
      8. Run file admin/cli/automated_backups.php from cli again.
        -> You should see in the output that the course is skipped with message "Skipping Course name (Not modified since previous backup process)"
      9. Go see in the restore page of the course that the backup hasn't changed (time).
      Show
      Go to "Site administration > Courses > Backups > Automated backup setup" and set Active dropdown list to Manual Testing of "Skipping Course (Not modified since X days)" Go to "Site administration > Courses > Backups > Automated backup setup" and select "3 days" in "Skip courses not modified since previous backup" Create a new course that is not hidden Run file admin/cli/automated_backups.php from cli (php admin/cli/automated_backups.php). -> You should see in the output that the course is skipped with message "Skipping Course name (Not modified since 3 days)" Go see in the restore page of the course that the backup is not there. Modifiy the course by adding any resources or activities (File, folders, assignment, forum...) Run file admin/cli/automated_backups.php from cli (php admin/cli/automated_backups.php). -> You should see in the output that the modified course is backed up. Go see in the restore page of the course that the backup is there. Directly in the database, change the timemodified and the logs of the course to greater than 3 days. Run file admin/cli/automated_backups.php from cli again. -> You should see in the output that the modified course is skipped with message "Skipping Course name (Not modified since 3 days)" Go see in the restore page of each courses that the backup hasn't changed (time). Testing of "Skipping Course (Not modified since previous backup process)" Go to "Site administration > Courses > Backups > Automated backup setup" and check "Skip courses not modified since previous backup" and select "never" in "Skip courses not modified since previous backup" Create a new course that is not hidden Run file admin/cli/automated_backups.php from cli (php admin/cli/automated_backups.php). -> You should see in the output that the course is skipped with message "Skipping Course name (Not modified since previous backup process)" Go see in the restore page of the course that the backup is not there. Modifiy the course by adding any resouces or activities (File, folders, assignment, forum...) Run file admin/cli/automated_backups.php from cli again. -> You should see in the output that the course is backed up. Go see in the restore page of the course that the backup is there. Run file admin/cli/automated_backups.php from cli again. -> You should see in the output that the course is skipped with message "Skipping Course name (Not modified since previous backup process)" Go see in the restore page of the course that the backup hasn't changed (time).
    • Affected Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
      MDL-35911-master

      Description

      we have an automated procedure that creates empty moodle courses - based on an external course system.
      this causes us to have many empty courses - some of them will never be filled.

      i would like to use the automated backup system, but it create backups for all the courses in the system, even the empty ones.

      i have some schools where there could be 300-400 courses, and only 5-10 active ones.

      i understand the an "empty" course is no somtheing definitive (no activities and resources ? no registered users? maybe we should let the admin set the parameters that define "empty" in their system ?)

      also,
      an option to choose only some categories to be backed-up would be nice

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ohameiri omer
              Peer reviewer:
              Damyon Wiese Damyon Wiese
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated: