Restore a Backup Keeping User Attempts

Re: Restore a Backup Keeping User Attempts

by Colin Fraser -
Number of replies: 0
Picture of Documentation writers Picture of Testers

Hamid, I am not sure that can be done without a bit of effort. This is a great idea but right now, there is no tool I am aware of that will siut your need. 

The trouble is that when you delete an assignment, you delete the responses to that assignment. You can backup tasks and assignments and student data related to those tasks and assignments - but you cannot separate them. You can do a backup of contents only easily, but you cannot do a similar backup of users and user data. The issue I would think lies in how Moodle orders and links the content and student responses in the database. You can take a backup of users only, but you do not get their data. You cannot reassign the data via the Moodle, but you might be able to via the database.

Do a backup of the data you need via phpMyAdmin and create a new course with the new materials. Do a backup of the new course, via phpMyAdmin, and you should be able to edit the two files together, replacing old unwanted data with the new required data manually. In doing this, you should be able to construct the SQL required to directly replace unwanted data. Test it a few time on different courses, see if you can make it generic enough to reuse the same code on all courses.