RT::Ex...geUsers(3pm)

πŸ“¦
version 1.10 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, welcome to RT::Extension::MergeUsers β€” it's the RT extension that merges two users into the same effective user. literally its whole thing. no cap. ✨


🌈 RT VERSION 🌈

It plays nice with RT 4.0, 4.2, 4.4, and 5.0. all of them. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea. This RT extension drops a "Merge Users" box onto the User Administration page, and it lets you merge the user you're currently staring at with another user on your RT instance. one click energy, honestly.

It also adds MergeInto and UnMerge functions to the RT::User class, so you can do the exact same thing programmatically from your own code. iykyk. πŸ’…

And it ALSO provides a version of CanonicalizeEmailAddress, which means all e-mail sent from secondary users shows up as coming from the primary user. obsessed with that.


πŸŽ€ INSTALLATION πŸŽ€

bestie, if you're upgrading, go read UPGRADING too. don't skip it, i'm begging.
  • perl Makefile.PL
  • make
  • make install
    • may need root permissions. yeah, the classic. 😭
  • Edit your /opt/rt5/etc/RT_SiteConfig.pm
    • If you're on RT 4.2 or greater, add this line:
Plugin('RT::Extension::MergeUsers');
  • For RT 4.0, add this line:
Set(@Plugins, qw(RT::Extension::MergeUsers));
  • or just add RT::Extension::MergeUsers to your existing @Plugins line. either way, we ball.
  • Clear your mason cache
rm -rf /opt/rt5/var/mason_data/obj
  • Restart your webserver

periodt. that's the whole install. πŸ’–


✨ UPGRADING ✨

If you're upgrading from 0.03_01 or earlier, you must run bin/rt-update-merged-users. like, mandatory bestie.

This script creates MergedUsers Attributes so RT can know when you're looking at a user that other users have been merged into. If you don't run it, you'll have issues unmerging users. πŸ’€

The good news? It can be safely run multiple times β€” it'll only create Attributes as needed. so spam it, it's fine, it's chill. 🫢


🌸 UTILITIES 🌸

🌟 rt-clean-merged-users

When a user with another user merged into it gets shredded, the attributes on that user are also shredded β€” but the merged user will remain, along with attributes that may point to the now-missing user id. πŸ‘€

This script cleans up attributes if the merged-into user record is now gone. Those users will then be converted back to regular unmerged users. healing arc fr. ✨

🌟 rt-merge-users

A command-line tool to merge one user into another. short king. iconic.


πŸ’… CAVEATS πŸ’…

πŸ’€ RT::Shredder and Merged Users

Merging a user effectively makes it impossible to load the merged user directly. Attempting to access the old user resolves to the merged-into user. it's giving... identity theft, but consensual.

Because of this, MergeUsers has some extra code to help RT::Shredder clean up these merged records, so it doesn't leave merged user records sitting in the DB while removing the user they were merged into.

When you run RT::Shredder on a user record with other users merged into it, the merged users are Unmerged before the initial user record is shredded. There are two options for handling these newly unmerged users:

  1. Re-run your shredder command with the same or similar options. The unmerged user records will now be accessible and, depending on your shredder options, they will likely be shredded on the second run. If you have multiple layers of merged users, you may need to run shredder multiple times. (yes, multiple times. it's giving onion. layers. πŸ§…)
  2. MergeUsers will log the unmerged users at the "info" level, so you can pull the user ids from the log and shred them manually. This is most likely to be useful if you're shredding one specific user (and all merged accounts).

πŸ‘‘ AUTHOR πŸ‘‘

Best Practical Solutions, LLC <modules@bestpractical.com>


πŸ› BUGS πŸ›

All bugs should be reported via email to

L<bug-RT-Extension-MergeUsers@rt.cpan.org|mailto:bug-RT-Extension-MergeUsers@rt.cpan.org>

or via the web at

L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-MergeUsers>.

This software is Copyright (c) 2014-2023 by Best Practical Solutions

This is free software, licensed under:

The GNU General Public License, Version 2, June 1991

and that's the whole page bestie!! 🌈✨ this one came from perl v5.40.1 and was dated 2025-03-16 β€” so if you're reading this, hi from the past, go merge some users, and remember: every single one of these details matters. stay iconic. πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from