Merge user accounts

Admin tools ::: 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.
Latest release:
1623 sites
62 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:

  1. 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
  2. Build a new issue clicking on and add the necessary detail to replay the failure or the trace to help you out, and/or
  3. 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!

Potential privacy issues

This plugin does not store any personal data.


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


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 Jordi Pujol-Ahulló
    Tue, Aug 14, 2018, 12:59 AM

    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:, 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!


    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

    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.


  • 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.

  • 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
    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!
  • 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:
    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
  • Picture of Jordi Pujol-Ahulló
    Tue, Aug 20, 2019, 4:54 PM
    Hi! Problems on Oracle support and other issues are addressed with the latest release of this plugin. Consider upgrading to benefit its improvements.
  • Picture of Jordi Pujol-Ahulló
    Tue, Aug 20, 2019, 5:25 PM
    Now on, we'll only give support via GitHub. Thanks for help us maintaining this plugin in our spare time.
    Thanks a lot for all your feedback.
  • Picture of Nicholas Catel
    Fri, Jul 10, 2020, 9:52 AM
    Hi, I am attempting to install this on our test site. Version 3.5.4 and I get this message;
    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/ on line 1858

    Is it because of the code in the plugin, or something in our Moodle.

    Thank you
1 2 3 4 5 6 7 8 9
Please login to post comments