Enrolment

 
 
Picture of Kate Rhodes
Merging multiple accounts?
 

Does anyone know if there is a way of taking two user accounts and merging them into one? The problem I'm having is there are several students who created themselves an account to take a course. Then, they couldn't remember their login the next time they came back to take another course so they created a new account.  So now I have users with two accounts, one showing completion of one course, and another showing the completion of other courses. We need them to have just one account with all their course completions in them.

We're running moodle 2.4.

Thanks!

 
Average of ratings: -
Picture of Iñaki Arenaza
Re: Merging multiple accounts?
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

That's a really difficult question. While it is technically possible to do it, it's quite complicated and error-prone. You would need to modify Moodle's database directly in a lot of places, which is quite risky unless you know the database structure very well.

There are two ways Moodle refers to a users:

  • by their usernames (which is only used in very fewplaces, like the user list table, the logs table, and probably one or two other places),
  • by their internal numeric IDs (which is used almost everywhere). This is where you should put all your efforts.

You would need to modify every single table that references the internal ID and change if from the soon-to-be-discarded-ID to the want-to-keep-user-ID. Of course this means you should already know which those tables are, which depending on your Moodle version and the contributed plugins you have installed can vary quite a bit.

As I said before, while technically possible, it's not trivial at all.

Oh, and by the way, don't even try to do anything like this before having full backups of your Moodle database and having restored them at least once (so you know you can recover when you screw up your database).

Saludos. Iñaki.

 
Average of ratings: -
Picture of Kate Rhodes
Re: Merging multiple accounts?
 

Oh I hear you. We're not even going in that direction! I've already been told not to do that.

I was wondering if we can manually enrol/grade each user.... so what I mean is if we take the course and outcomes from one account, and then manually go in and enter that information in the other account. We have 12 users we need to try and consolidate....

Would it be worth a try?

 

 
Average of ratings: -
Picture of Iñaki Arenaza
Re: Merging multiple accounts?
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Yes, that should be possible (manually enrolling and grading the users). You would miss some things (e.g., assigment uploads won't exist, even if you grade them), but it could be good enough for your needs.

Saludos. Iñaki.

 
Average of ratings: -
Sketch...
Re: Merging multiple accounts?
Group Particularly helpful Moodlers

Not "officially", but the question has come up lots of times. Read the User Merge Utility discussion.

And perhaps vote for MDL-24443

 
Average of ratings: -