MyBB Community Forums

Full Version: repair deleted account
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to repair a deleted account.
All posts are still from this person in my forum, also the name of the person.
Only in all post under the usersname is the text unregistered.
Possible yes, but requires some effort.

Basically, make a new user with the original username.

Then run the following SQL query:
UPDATE mybb_posts SET uid=<new uid> WHERE username="<new username>"
Replace <new uid> and <new username> with the uid and username of the user just made.
You would need to do it directly via phpMyAdmin/MySQL.

First you need the user ID of the user, if you don't already have it then you'd have to track it down using phpMyAdmin by searching for one of the posts by the user and getting the value of the uid column.

After you've managed to fetch the user ID, a simple insert query to recreate the user would work fine.

INSERT INTO mybb_users (uid,username,password,usergroup) VALUES ('USER ID HERE', 'USERNAME', md5('PASSWORD'), 2);

That will recreate the user with the speicifed user ID, username, password and place them in to the registered users group.

Regards,
Chris
I tried to do it but nothing happen.
The userid I found in myphpadminis 0 (because she was deleted).
Her usersname is still in the List (Krissy)

I went to the mybb users and clicked on add.
Then I put the vallues like I showed in my attachment and clicked on start.

When I fill in the 4 vallues and click on start, her name is in the list but as a new user. No old messages are in the list.

Chris Boulton Wrote:You would need to do it directly via phpMyAdmin/MySQL.

First you need the user ID of the user, if you don't already have it then you'd have to track it down using phpMyAdmin by searching for one of the posts by the user and getting the value of the uid column.

After you've managed to fetch the user ID, a simple insert query to recreate the user would work fine.

INSERT INTO mybb_users (uid,username,password,usergroup) VALUES ('USER ID HERE', 'USERNAME', md5('PASSWORD'), 2);

That will recreate the user with the speicifed user ID, username, password and place them in to the registered users group.

Regards,
Chris
Both of the methods do not work, the userid still is 0.
When you edit the user in phpMyAdmin, change the UID so that it is not zero (if you remember what the user ID was before, it is best to change it back to that one, if not, choose another "gap" or use the "next" possible number)

Then confirm that the user now has a user ID, and run this query:
UPDATE mybb_posts SET uid='NEW UID' WHERE username='Krissy'