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

Allow to specify $CFG->backupdir instead of default $CFG->tempdir . '/backup'

    XMLWordPrintable

Details

    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_35_STABLE
    • m35_MDL-60923_New_BackupDir_Setting-v2
    • Hide

      Ideally, any component/area touched by the changes in the PR should be tested i.e. backuping and restoring courses, including blocks, resources and activities, even Moodle 1 backups.

      Regressions

      1. A new Moodle instance installation (done both via WEB and CLI)
        • Unit and Behat tests should pass
        • Restore a course on it
        • Create a new course with some activities, create a backup of it and download the backup locally on your PC, then delete the course and restore it by means of the last backup
      2. An existing Moodle instance, upgraded
        • Unit and Behat tests should pass
        • Restore a course on it
      3. A new Moodle instance installation done via CLI with a custom dataroot (-MDL-30381-)
        • Unit and Behat tests should pass
        • Restore a course on it
        • Create a new course with some activities, create a backup of it and download the backup locally on your PC, then delete the course and restore it by means of the last backup

      Configure a different $CFG->backuptempdir in a new installation initially using the default path

      1. Repeat the tests above for a new Moodle installation, looking now at the contents of the custom backup temp directory that should contain some files, including the .htaccess file
      2. touch the temp backup files to change the modified attribute to get them older than 1 week (e.g. touch -md "1 Feb" <file>), then force the run of the Delete stale temp files: the "touched" temp backup files should be removed since they are older than 1 week
      Show
      Ideally, any component/area touched by the changes in the PR should be tested i.e. backuping and restoring courses, including blocks, resources and activities, even Moodle 1 backups. Regressions A new Moodle instance installation (done both via WEB and CLI) Unit and Behat tests should pass Restore a course on it Create a new course with some activities, create a backup of it and download the backup locally on your PC, then delete the course and restore it by means of the last backup An existing Moodle instance, upgraded Unit and Behat tests should pass Restore a course on it A new Moodle instance installation done via CLI with a custom dataroot (- MDL-30381 -) Unit and Behat tests should pass Restore a course on it Create a new course with some activities, create a backup of it and download the backup locally on your PC, then delete the course and restore it by means of the last backup Configure a different $CFG->backuptempdir in a new installation initially using the default path Repeat the tests above for a new Moodle installation, looking now at the contents of the custom backup temp directory that should contain some files, including the .htaccess file touch the temp backup files to change the modified attribute to get them older than 1 week (e.g. touch -md "1 Feb" <file> ), then force the run of the Delete stale temp files : the "touched" temp backup files should be removed since they are older than 1 week

    Description

      Usage of $CFG->tempdir . '/backup' is strewn across Moodle source code.

      I propose to create a new var $CFG->backupdir (or $CFG->backuptempdir), defaulting to "$CFG->tempdir . '/backup'" to maintain backwards compatibility) to allow a single point allowing to change the location of the backup temp files if needed.

      This is similar to MDL-28701, where $CFG->tempdir and $CFG->cachedir were introduced.

      Attachments

        Issue Links

          Activity

            People

              matteo Matteo Scaramuccia
              mina Nicolas Martignoni
              Marina Glancy Marina Glancy
              Andrew Lyons Andrew Lyons
              Mark Nelson Mark Nelson
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              8 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/18