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

Backup and Restore lastaccess to course

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup Before applying patch

      1. Log in as admin and go Site administration > Development > Make test course
      2. In the form create Size of Course XS and fill in a Short Name for the course click Create Course and then click Continue
      3. In the Navigation block of the course click Participants and login as this user, normally would be tool_generator_000001 for username and the password is set in config.php $CFG->tool_generator_users_password
      4. Access the course as this user and then login as admin again
      5. Check in the Navigation block of the test course under Participants that the test user has a value to Last access to course
      6. Create a backup without the patch for testing
      7. Download it for later use and name it old-backup.mbz

      Setup

      1. Apply the patch

      Testing backup

      1. Log in as admin and open the course prepared in the setup
      2. Click on the Cog Wheel and then click Backup
      3. Mark the Include course logs checkbox and then click Jump to final step
      4. Click Continue
      5. Click Download
      6. Copy the file backup-moodle2-course---154.mbz to backup.tar.gz
      7. (Optional) Unzip the backup.tar.gz
      8. Go to backup > course and check that there is a file loglastaccess.xml
      9. Open the file and check that there are two users in there (test user and admin)

      Testing backup no user information

      1. Log in as admin and open the course prepared in the setup
      2. Click on the Cog Wheel and then click Backup
      3. Unmark the Include enrolled users checkbox and then click Jump to final step
      4. Click Continue
      5. Click Download
      6. Copy the file backup-moodle2-course---191.mbz to backup-nouserinfo.tar.gz
      7. (Optional) Unzip the backup-nouserinfo.tar.gz
      8. Go to backup > course and check that there is not a file loglastaccess.xml

      Testing restore new course

      1. Log in as admin and open Site administration > Courses > Restore course
      2. Choose file and pick the backup.tar.gz file or the corresponding .mbz and click Restore
      3. Click Continue on the Confirm page
      4. On the next (Destination) page select a category in Restore as new course and click Continue
      5. On the next (Settings) page click Next
      6. On the next (Schema) page click Next
      7. On the next (Review) page click Perform restore
      8. On the last page click Continue
      9. In the Course Navigation block click on Participants
      10. Confirm that the Last access to course has a value other than Never

      Testing restore delete contents and restore

      1. Log in as the test user to the original course so that the last access get updated.
      2. Log in as admin and open Site administration > Courses > Restore course
      3. Choose file and pick the backup.tar.gz file or the corresponding .mbz and click Restore
      4. Click Continue on the Confirm page
      5. On the next (Destination) page select the radio button Delete the contents of the existing course and then restore and select the original Course in the list
      6. On the next (Settings) page click Next
      7. On the next (Schema) page click Next
      8. On the next (Review) page click Perform restore
      9. On the last page click Continue
      10. In the Course Navigation block click on Participants
      11. Confirm that the Last access to course has a value other than Never

      Testing restore merge course

      1. Log in as the test user to the original course so that the last access get updated.
      2. Log in as admin and open Site administration > Courses > Restore course
      3. Choose file and pick the backup.tar.gz file or the corresponding .mbz and click Restore
      4. Click Continue on the Confirm page
      5. On the next (Destination) page select the radio button Merge the backup course into the existing course and select the original Course in the list
      6. On the next (Settings) page click Next
      7. On the next (Schema) page click Next
      8. On the next (Review) page click Perform restore
      9. On the last page click Continue
      10. In the Course Navigation block click on Participants
      11. Confirm that the Last access to course has a the same value as before the merge

      Testing restore new course with backup before file

      1. Log in as admin and open Site administration > Courses > Restore course
      2. Choose file and pick the old-backup.mbz file and click Restore
      3. Click Continue on the Confirm page
      4. On the next (Destination) page select a category in Restore as new course and click Continue
      5. On the next (Settings) page click Next
      6. On the next (Schema) page click Next
      7. On the next (Review) page click Perform restore
      8. On the last page click Continue
      9. Make sure that no errors have occured.
      Show
      Setup Before applying patch Log in as admin and go Site administration > Development > Make test course In the form create Size of Course XS and fill in a Short Name for the course click Create Course and then click Continue In the Navigation block of the course click Participants and login as this user, normally would be tool_generator_000001 for username and the password is set in config.php $CFG->tool_generator_users_password Access the course as this user and then login as admin again Check in the Navigation block of the test course under Participants that the test user has a value to Last access to course Create a backup without the patch for testing Download it for later use and name it old-backup.mbz Setup Apply the patch Testing backup Log in as admin and open the course prepared in the setup Click on the Cog Wheel and then click Backup Mark the Include course logs checkbox and then click Jump to final step Click Continue Click Download Copy the file backup-moodle2-course---154.mbz to backup.tar.gz (Optional) Unzip the backup.tar.gz Go to backup > course and check that there is a file loglastaccess.xml Open the file and check that there are two users in there (test user and admin) Testing backup no user information Log in as admin and open the course prepared in the setup Click on the Cog Wheel and then click Backup Unmark the Include enrolled users checkbox and then click Jump to final step Click Continue Click Download Copy the file backup-moodle2-course---191.mbz to backup-nouserinfo.tar.gz (Optional) Unzip the backup-nouserinfo.tar.gz Go to backup > course and check that there is not a file loglastaccess.xml Testing restore new course Log in as admin and open Site administration > Courses > Restore course Choose file and pick the backup.tar.gz file or the corresponding .mbz and click Restore Click Continue on the Confirm page On the next (Destination) page select a category in Restore as new course and click Continue On the next (Settings) page click Next On the next (Schema) page click Next On the next (Review) page click Perform restore On the last page click Continue In the Course Navigation block click on Participants Confirm that the Last access to course has a value other than Never Testing restore delete contents and restore Log in as the test user to the original course so that the last access get updated. Log in as admin and open Site administration > Courses > Restore course Choose file and pick the backup.tar.gz file or the corresponding .mbz and click Restore Click Continue on the Confirm page On the next (Destination) page select the radio button Delete the contents of the existing course and then restore and select the original Course in the list On the next (Settings) page click Next On the next (Schema) page click Next On the next (Review) page click Perform restore On the last page click Continue In the Course Navigation block click on Participants Confirm that the Last access to course has a value other than Never Testing restore merge course Log in as the test user to the original course so that the last access get updated. Log in as admin and open Site administration > Courses > Restore course Choose file and pick the backup.tar.gz file or the corresponding .mbz and click Restore Click Continue on the Confirm page On the next (Destination) page select the radio button Merge the backup course into the existing course and select the original Course in the list On the next (Settings) page click Next On the next (Schema) page click Next On the next (Review) page click Perform restore On the last page click Continue In the Course Navigation block click on Participants Confirm that the Last access to course has a the same value as before the merge Testing restore new course with backup before file Log in as admin and open Site administration > Courses > Restore course Choose file and pick the old-backup.mbz file and click Restore Click Continue on the Confirm page On the next (Destination) page select a category in Restore as new course and click Continue On the next (Settings) page click Next On the next (Schema) page click Next On the next (Review) page click Perform restore On the last page click Continue Make sure that no errors have occured.
    • Affected Branches:
      MOODLE_311_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull 3.11 Branch:
      MOODLE_311_STABLE-MDL-71190-backup-lastaccess
    • Pull Master Branch:
      master-MDL-71190-backup-lastaccess

      Description

      When restoring a backup of a course that has at least one enrolled user whom accessed the course, the column Last access to course in the table of Participants is not restored.

      This column is retrieved from the table user_lastaccess, which contains the fields: id, userid, courseid and timeaccess. On March 30th 2018 there has been a other user who's had the same issue see: https://moodle.org/mod/forum/discuss.php?d=368214

        Attachments

          Activity

            People

            Assignee:
            scottverbeek Scott Verbeek
            Reporter:
            scottverbeek Scott Verbeek
            Peer reviewer:
            Heena Agheda Heena Agheda
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            Anna Carissa Sadia Anna Carissa Sadia
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 45 minutes
                6h 45m