Admin tools: Merge user accounts

tool_mergeusers
Maintained by Picture of Nicolas DunandNicolas Dunand, Picture of Jordi Pujol-AhullóJordi Pujol-Ahulló
This administration tool will merge two Moodle user accounts into one.
1129 sites
944 downloads
47 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.

Potential privacy issues

This plugin does not store any personal data.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Picture of Nicolas Dunand
Nicolas Dunand (Lead maintainer): author
Picture of Jordi Pujol-Ahulló
Jordi Pujol-Ahulló: author
Picture of Forrest Gaston
Forrest Gaston: contributor
Mike Holzer
Mike Holzer: contributor
Picture of RISET Université de Lausanne
RISET Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Evan Abbey
    Wed, Jul 18, 2018, 12:41 AM
    Will do, thx Jordi
  • Picture of Trish Evans
    Mon, Aug 13, 2018, 8:41 AM
    I used your tool to try to combine two accounts. It appears to have worked however when the user attempted to run a grade report it gave the following error :

    Debug info:
    Error code: nopermissions

    Stack trace:
    line 808 of /lib/accesslib.php: required_capability_exception thrown
    line 65 of /grade/report/grader/index.php: call to require_capability()

    The role for this user in this course hasn't changed and is ARCHETYPE: Teacher (editing).

    Any input would be appreciated.
  • Picture of Trish Evans
    Mon, Aug 13, 2018, 8:47 AM
    Re above query - we are on Moodle version 3.4.3
  • Picture of Jordi Pujol-Ahulló
    Tue, Aug 14, 2018, 12:59 AM
    Hi!

    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- big grin ).

    Thank you so much for your time Trish!

    Jordi


    Do you think
  • Picture of Rob Mills
    Thu, Apr 25, 2019, 1:04 AM
    I am using 3.6.2. Can this plugin be expected to work? I can't install it directly from here - won't allow me. I would have to download and install manually.
  • Picture of East Riding College eLearning
    Wed, May 29, 2019, 6:36 PM
    Hi

    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
  • Picture of Manabu Abe
    Wed, Jun 26, 2019, 10:48 AM
    Hi there,
    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.
  • Picture of Manabu Abe
    Thu, Jun 27, 2019, 9:47 AM
    Sorry, ignore my previous post as I just realized I used an older version.
  • Picture of Nicolas Dunand
    Thu, Jun 27, 2019, 12:59 PM
    Hi Manabu,
    Thanks for reporting back and clarifying. I'm glad updating to the newest version solved your problem.
  • Health & Safety Training Ninja
    Fri, Jul 19, 2019, 9:55 PM
    Issues: There is some useful profile data which is not transferred to the user to keep after merge. Mainly to do with login records.

    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
  • Picture of Helder Pereira
    Wed, Jul 24, 2019, 10:49 PM
    Hello. Let me start by congratulating your work on this excellent plugin.
    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.
  • Picture of Jordi Pujol-Ahulló
    Thu, Jul 25, 2019, 2:58 PM
    Hi!
    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
  • Picture of Nicolas Dunand
    Thu, Jul 25, 2019, 3:38 PM
    Hi Helder,

    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?
  • Picture of Helder Pereira
    Thu, Jul 25, 2019, 5:31 PM
    Hi Nicolas. Our interaction on github solves the problem.
    I will now try some test cases.
    Thank you a lot!
  • Picture of Aaditya Daiya
    Thu, Aug 15, 2019, 6:36 PM
    thanks for this information
1 2 3 4 5 6 7 8 9
Please login to post comments