MyBB Community Forums

Full Version: Merging deleted user into another user?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, so I have a few deleted user accounts on my forum and I was curious if there was a way to change them to actual accounts via phpMyAdmin. It's pretty annoying when I see their posts and they're set to 'Guest' (a disgruntled admin deleted them a long while ago). Can I change these accounts into an account that registered before they did?

Thanks for the help in advance!
I'm not sure there's something built in, but you could run this in phpmyadmin:

UPDATE mybb_posts SET uid='new uid' WHERE uid= 'old uid'
UPDATE mybb_threads SET uid='new uid' WHERE uid= 'old uid'

No guarantees on it working, though.
But if the user is deleted there will not be a uid, right?
Correct. Use the same query as above, but try setting the "old uid" as blank or 0 (I can't remember how MyBB stores them for deleted users/guests).
You could do username, I believe that is still in the DB.
How should the query look if I want to do it by username?
Run these queries in phpMyAdmin:

UPDATE `mybb_threads` SET `uid` = 'X' WHERE `username` = 'Y';
UPDATE `mybb_posts` SET `uid` = 'X' WHERE `username` = 'Y';

Where X is the new account ID and Y is the old username.

Then go to ACP >> Tools & Maintenance >> Recount & Rebuild and rebuild/recount the first 4 options.
Worked like a charm, thank you very much!