Restore a Backup Keeping User Attempts

Restore a Backup Keeping User Attempts

by Hamid Takesh -
Number of replies: 4

Hello everyone,

I am trying to achieve the following:

We have three schools running three different Moodle Installations with students / teachers enrolled. And there is one central Moodle Installation where course content developement happens, this installation only have administrators and course creators enrolld.

So if for example we are talking about a Pre-Calculus Course for Grade 11 that is currently being used in all three schools, students have some quizes attempts, some assignments uploaded, etc. And in the middle of the year the course is decided to be modified. The modification happnes in that one central installation and then must be applied to the three child sites.

So the question is: how do I take the backup of the course contents ONLY (no user info) and restore it in the three schools without losing the quizez attempts and assignments uploads done by the students? I just want to update the course content (for example better lessons images or slight course rescheduling).

Thanx.

Average of ratings: -
In reply to Hamid Takesh

Re: Restore a Backup Keeping User Attempts

by Doug Osborne -

I have the same question, for a slightly different reason.  Due to an upgrade from 1.9 to 2.4 I need to update the course content, while maintaining the grades/progress information for the users.  The changes will take 2+ days to make, and we can't afford that downtime to make the on the live server, so we need to make them on a staging server then restore on the live server.  I've searched all over, haven't found an answer, and also posted with no response.  Will someone at least say "I don't know?"

If it can't be done through Moodle's backup/restore system, can it be done by overwriting a database table?

In reply to Doug Osborne

Re: Restore a Backup Keeping User Attempts

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Doug, that can be done, easily, but I would recommend that you get the latest v2.2.x release and use that to stage. Any updates you need can be made there so your courses and materials can just slide straight into the v2.4.

In reply to Hamid Takesh

Re: Restore a Backup Keeping User Attempts

by Colin Fraser -
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.