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

admin/cli/backup.php improvement to backup entire category to directory

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • 3.8
    • Backup
    • MOODLE_38_STABLE
    • MDL-67553-master
    • Hide

      1) run php admin/cli/backup.php --courseid=NUMBER --destination=/tmp/NUMBER.mbz
      2) verify that /tmp/NUMBER.mbz is created from course with NUMBER id.

      1) run php admin/cli/backup.php --destination=/tmp --categoryid=NUMBER
      2) verify that each Course form category with id NUMBER is backed up in directory /tmp

      Show
      1) run php admin/cli/backup.php --courseid=NUMBER --destination=/tmp/NUMBER.mbz 2) verify that /tmp/NUMBER.mbz is created from course with NUMBER id. 1) run php admin/cli/backup.php --destination=/tmp --categoryid=NUMBER 2) verify that each Course form category with id NUMBER is backed up in directory /tmp

    Description

      It is a nice idea to be able to bulk backup/restore entire category to directory using cli.
      I also thought it would be handy to name the backup file yourself instead of naming itself.
      For that reason I have attempted to add below extra improvements to existing backup.php script:

      1) --destination=STRING can be either a directory or file. If it is a file then the course is backed up to that specific file, otherwise the files are autonamed. If destination is not provided the moodle backup course area is used.
      2) --categoryid=id if combined with --destination=directory then the script backs up all courses of category with id to the directory specified, autonaming the files.

      Please feel free to use/comment/improve.

      You should also read related discussion : https://moodle.org/mod/forum/discuss.php?d=394427

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lazarosfs Lazaros Sotiriadis
              Nicolas Martignoni Nicolas Martignoni
              Votes:
              16 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 26 minutes
                  26m

                  Clockify

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