Moodle Plugins directory: Merge user accounts | Moodle.org
Merge user accounts
Reports ::: report_mergeusers
Maintained by
Nicolas Dunand
This script will merge two Moodle user accounts, "user A" and "user B".
The intent of the script is to assign all activity & records from user A to
user B. This will give the effect of user B seeming to have done everything
both users have ever done in Moodle.
Latest release:
20 sites
29 downloads
11 fans
Current versions available: 1
All administrators who installed this plugin are kindly invited to replace it by this: https://moodle.org/plugins/view.php?plugin=tool_mergeusers, since the report_mergeusers plugin is no longer maintained.
In addition, there is a lot of new functionality (CLI scripts, merging reports stored in database, etc See the included README.txt for more details).
Useful links
Contributors
Nicolas Dunand (Lead maintainer): author
Mike Holzer: author
Forrest Gaston: author
Jordi Pujol-Ahulló: author
CSE Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them
Thank you for making this plugin. I think this is a fantastic idea! I was able to get the plugin installed, but I'm not able to get it operate. When I try to operate the plugin on my dev site I'm getting the following error:
Merging «mergedaccount2» (user ID = 6) into «mergedaccount1» (user ID = 5)
Unsupported database type
Debug info:
Error code: errordatabase
Stack trace:
line 476 of /lib/setuplib.php: moodle_exception thrown
line 126 of /report/mergeusers/index.php: call to print_error()
Here is some information about by dev site:
Moodle -- 2.5 (Build: 20130514)
MySQL -- 5.5.30
PHP -- 5.4.15
Do you know why this error might be occurring? I've attempted to debug, but there isnt' much to work with. Any insight would be great appreciated. Thank you!!
Cheers.
Steve.
Thanks for your feedback. This comes from a typo in the code: on line 117 of /report/mergeusers/index.php , "mysql" should be "mysqli". You can correct this file yourself if you're in a hurry, and I'll update the code in GitHub and here ASAP.
Thanks for your reply and insight. I and made the modification and tested it, but it didn't work. I decided to do a find an replace on all "mysql" for "mysqli". Once I replaced all the instances of "mysql" it worked. It needs to be updated on:
Line 117
Line 147
Line 171
Line 210
I hope this helps. Thanks! Cheers!
Steve.
After getting the modification in place for "mysql" to "mysqli" as mentioned in the prior post, I'm getting an error when I look at the merged profile. Here is what I'm seeing:
Error: mdb->get_record() found more than one record!
line 1409 of /lib/dml/moodle_database.php: call to debugging()
line 1369 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
line 1348 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 269 of /user/profile/lib.php: call to moodle_database->get_record()
line 36 of /user/profile/lib.php: call to profile_field_base->load_data()
line 357 of /user/profile/lib.php: call to profile_field_base->profile_field_base()
line 106 of /user/editadvanced.php: call to profile_load_data()
It looks like it is creating a duplicate record instead of updating the prior record. Do you have any insight on why that might be occurring? Please let me know if I can provide any additional information. THANK YOU! Cheers.
Steve.
My name is Jordi from the Universitat Rovira i Virgili of Tarragona, Catalonia, Spain.
We use Moodle in our university and, by now, have lots of cases of duplicated users. Most of them by changes on the personal identifiers of Moodle users, synced from ldap.
We have forked your plugin in github and expect to work on it on common Moodle things in short.
We created a similar script on M1.9 and maintained by only us. We join efforts working on this plugin, hoping more feedback and having a great mergin tool that I can see is a headache by most of administrators.
Thanks a we'll be back soon.
Jordi
Thanks for providing feedback, I'm looking forward to seeing what you have in mind
You can find newer versions of this plugin on the github repository, with several improvements:
* Easier management of database table exceptions and compound indexes.
* CLI support. Now for just asking for user ids to merge, but it nows allows you to build your own CLI scripts for autmoatic mergings, very very easy.
* No more external logging is required. Any merging action is automatically recorded into the database for further reference. To do so, two links are shown in the settings: one for merging and another one for seeing last merging actions and their status.
* Code has been rewritten in most of parts to enable the above functionality and also to be more Moodle-friendly, even thought it always can be improved, for sure.
And the last one, remember that this plugin is no longer a report, but a tool for administrators, as you can see from source code.
Hoping to see feedback and experiences of its use
Saludos,
Jordi
As stated by Jordi above, this plugin has now been replaced by the tool_mergeusers plugin and is not maintained any more.
The new plugin should be available here: https://moodle.org/plugins/view.php?plugin=tool_mergeusers shortly and is already available in GitHub here: https://github.com/ndunand/moodle-mergeusers
All administrators who installed this plugin are kindly invited to replace it by this: https://moodle.org/plugins/view.php?plugin=tool_mergeusers, since the report_mergeusers plugin is no longer maintained.
In addition, there is a lot of new functionality (CLI scripts, merging reports stored in database, etc See the included README.txt for more details).
Saludos,
Jordi
We want to use this plugin, but our Moodle Partner is telling us it is given index problems. Not sure what they mean by that. Can someone explain.
From our point of view, the merge works great, all of content from account A does get transfered to account B, the attendance, evlauation and reports are moved as well.
Thanks
Marie-Pierre
As stated by Jordi above, this plugin has been obsoleted. Please refer to its successor, https://moodle.org/plugins/view.php?plugin=tool_mergeusers .