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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8
    • Fix Version/s: None
    • Component/s: Backup
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-67553-master

      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

              Assignee:
              Unassigned
              Reporter:
              lazarosfs Lazaros Sotiriadis
              Peer reviewer:
              Nicolas Martignoni
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              12 Vote for this issue
              Watchers:
              13 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 - 11 minutes
                  11m