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

Ability to backup and restore of enrolment plugins data

XMLWordPrintable

    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-47323-enrol-plugin-backup
    • Hide

      A) To test the additional functionality, one needs to install an enrol plugin that uses the new features. I've created a sample one in github.

      1. Clone https://github.com/mpetrowi/enrol_backuptest.git into enrol/backuptest.
      2. Go to the notifications page so that the plugin installs.
      3. In Site Admin -> Plugins -> Enrolments -> "Manage enrol plugins", enable the "Enrolment Backup test" enrol plugin.
      4. Create a new course.
      5. Go to Users->"Enrolment methods" in course administration block.
      6. Add "Enrolment backup test" to the course
      7. Fill in the form with some value for term and select a role, then click "Add method".
      8. Backup the course.
      9. Restore the backup into a new course.
      10. In the new course, go to Users->"Enrolment methods" in course administration block and click on the "Backup test" instance
      11. Verify that term and role are the same as were set in the first course.

      B) Ensure both phpunit and behat (@core_backup) work without a problem.

      C) Verify old backups, not containing enrol plugin support, continue restoring without problem. For that purpose, the backup file attached @ MDL-44053 can be used. It should end without any warning related to enrollments and with 1 "facilitator" and 2 "learners" after restore.

      Show
      A) To test the additional functionality, one needs to install an enrol plugin that uses the new features. I've created a sample one in github. Clone https://github.com/mpetrowi/enrol_backuptest.git into enrol/backuptest. Go to the notifications page so that the plugin installs. In Site Admin -> Plugins -> Enrolments -> "Manage enrol plugins", enable the "Enrolment Backup test" enrol plugin. Create a new course. Go to Users->"Enrolment methods" in course administration block. Add "Enrolment backup test" to the course Fill in the form with some value for term and select a role, then click "Add method". Backup the course. Restore the backup into a new course. In the new course, go to Users->"Enrolment methods" in course administration block and click on the "Backup test" instance Verify that term and role are the same as were set in the first course. B) Ensure both phpunit and behat (@core_backup) work without a problem. C) Verify old backups, not containing enrol plugin support, continue restoring without problem. For that purpose, the backup file attached @ MDL-44053 can be used. It should end without any warning related to enrollments and with 1 "facilitator" and 2 "learners" after restore.

      Currently there is no allowance for enrol plugins to define additional backup structure or to annotate custom enrol fields. The proposed changes address these shortcomings.

      The changes are:

      1. Add a backup plugin structure for enrol, as well as new backup/restore plugin classes.
      2. Add a backup execution step which calls a new method enrol_plugin::backup_annotate_custom_fields() in which plugins can annotate custom fields.

            mpetrowi Matt Petro
            mpetrowi Matt Petro
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Dan Poltawski Dan Poltawski
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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