MyBB Community Forums

Full Version: Restore user accidentally deleted
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have accidentally deleted a user.

Fortunately all her threads and posts are still on my forum (I deleted only username) but all posts/threads are posted as guest.

I have re-created user (username, password, her email), but how can I assign posts/thread on forum again to this user?

Thank you
The easiest way would be to edit the user's UID back to the old UID in the database. You can do this in the mybb_users table using phpMyAdmin.
Ok, then:

- I create again user with the same username and email (for example her new UID now is 1234);

- I go in Phpmyadmin and select my database;

- Then click on "Search" and in form I write:

Quote:Word "her old username (now guest with UID 0)"
Select all tables
In the field "username" (not her username but the field username);
And I search


In this way her old username is only in the field "username".

Then I click on "Show" in the results and in each post and thread I change UID from 0 to 1234?

Thanks
Yep, that should do the trick Smile
Ok, I had 400 results Confused

I have tried this and works:

UPDATE mybb_threads SET uid = 'new uid of user created' WHERE username = 'username of user';
UPDATE mybb_posts SET uid = 'new uid of user created' WHERE username = 'username of user';

Now works, thanks Big Grin