Admin tools: Merge user accounts
tool_mergeusers
Maintained by
Nicolas Dunand,
Jordi Pujol-Ahulló
This administration tool will merge two Moodle user accounts into one.
1498 sites
830 downloads
60 fans
Current versions available: 3
The intent 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.
This tool replaces the old report_mergeusers, which is now obsolete.
Help us
We do not give support in the comments section below. For any issue on the plugin, please, refer to GitHub and:
- Check if a related issue is already created with the exact detail or similar to the failure you're facing. Add your own experience too. Or
- Build a new issue clicking on https://github.com/ndunand/moodle-tool_mergeusers/issues/new and add the necessary detail to replay the failure or the trace to help you out, and/or
- Contribute to the plugin with a PR addressing the problem you're solving.
Help us manage this plugin in a more comfortable way in our spare time by using GitHub. Thanks in advance!
Useful links
Contributors
Nicolas Dunand (Lead maintainer): author
Jordi Pujol-Ahulló: author
Forrest Gaston: contributor
Mike Holzer: contributor
RISET Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them
Thanks for reporting.
This sound very strange. This is something totally new.
There should not be any problem about merging two accounts, if both are teacher (editing teacher).
I would like to give you more feedback, but we need more detail on this.
I propose you to start a new issue in our Github project: https://github.com/ndunand/moodle-tool_mergeusers/issues/new, so that we keep a single discussion, without mixups, on this issue. Please, on the new issue at github, report the above information and the log (as much as possible) for the merged users (as a text file or so -copy&paste-
Thank you so much for your time Trish!
Jordi
Do you think
Apologies if this has been asked before but is there any danger in deleting the account that becomes hidden once the merge has taken place? I'm thinking any assignments that a teacher has set up being deleted and things of that nature.
Thanks
Phil
I love the concept of the plugin and wanted to start using it.
Today, I tried it and it said Unsupported database type: {$a}. Do you have any idea how I can fix it? When I tested it with MariaDB (10.3.15), it said not supported.
We are using MySQL 5.7.26 and Moodle 3.5.3.
Thanks for reporting back and clarifying. I'm glad updating to the newest version solved your problem.
I noticed when merging user accounts the details in the user profile field for "firstaccess" and "lastaccess" go un-populated once the accounts have been merged. This is despite the user to remove having details populated for these fields. Checking in the database, it's actually all the following fields do not pull over the data from the user to remove profile: "firstaccess", "lastaccess", "currentlogin", "lastip". I feel these are very important fields to fully merge into the updated profile and gives quick access when viewing profiles.
I release these fields maybe populated on both accounts, therefore in this case the merge should take the earliest "firstaccess" date, the last "lastaccess" date and the last "currentlogin". For whichever profile has the currentlogin closest to the current date, the "lastip" should be taken from which ever profile that was - all this data can then be merged to the "user to keep" profile, without necessarily deleting it from the old (now suspended user to remove).
I hope you take on the above suggestion as it solves a few issues from an Admin perspective; it would certainly help me out at present.
Aside from the above, there's also user preferences to merge, but I can understand why this has not been incorporated to the merge plugin.
Thanks
I have one problem, I have an installation of Moodle on a Oracle 11gR2 database.
I read a lot from the plugin but I did not see that Oracle wasn't supported. Only non transactional databases. Oracle is transactional.
But after installing the plugin when I try to access it I get an error "Error: Database type oci not supported.".
So my question is, will this function in Oracle or not? Thank you.
Thanks for the kind words.
Actually, this plugin works with any database, accepting transactions or not. The important thing is that de database allowing transactions in order to prevent applying changes partially in case of any error.
You, as administrator, can prevent from working if the current database does not accepts transactions.
Regarding Oracle, it should work, since Moodle works with Oracle. Maybe we have any considerations or restrictions in the plugin code for some reason (I don't remember right now). Please, open an issue on the github repo to tell us this problem.
Thanks a lot for reporting!
Jordi
Thanks for your feedback and for reporting this issue. As Jordi stated, transactional support is not mandatory – and anyway Oracle supports it.
The error "Error: Database type oci not supported." comes from the fact that we check for each database type explicitly in the code, but we don't check against 'oci' (Oracle). I've opened a GitHub issue with the relevant code section to be changed: https://github.com/ndunand/moodle-tool_mergeusers/issues/152.
I however don't have any Oracle database at hand to try it out. Could you try the SELECT query I mention in the GitHub issue?
I will now try some test cases.
Thank you a lot!
Thanks a lot for all your feedback.
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; date_iterator has a deprecated constructor in /home/281254.cloudwaysapps.com/yzyqskmezg/public_html/mod/tracker/locallib.php on line 1858
Is it because of the code in the plugin, or something in our Moodle.
Thank you