Xenforo MySQL Database Question

THM

Aspirant
Joined
Aug 10, 2017
Messages
36
So several users were deleted on our site.
The system labels their posts as "Deleted user (number)"
The data still exists in the database.

They wish to return. I know their Username (from their content), email, and other data.
How can I fill in these values so that these members are reinstated? There MUST be a way of doing it if the data is still there.

TIA.
 

mysiteguy

Fanatic
Joined
Feb 20, 2007
Messages
3,619
select user_id from xf_user where username="theirusername";
That will give you their user id, assuming it's different from (number), but it should be the same. Let's assume it's 4102.

These will turn all of user 4102's posts and threads to non-moderated, visible:
update xf_thread set discussion_state="visible" where user_id=4102;
update xf_post set message_state="visible" where user_id=4102;
 

THM

Aspirant
Joined
Aug 10, 2017
Messages
36
What I want to do is to replace that "Deleted Member (number)" with the old username and reactivate the account.

It looks to me like that is NOT possible. As the accounts themselves (but not the threads) have been deleted and replaced with a "0" in the thread database. I don't know what the numbers in the nicknames "Deleted member (number)" represent, but I do not see them in any database table.
 
Last edited:

THM

Aspirant
Joined
Aug 10, 2017
Messages
36
Related to this---

How can I do a "find and replace" to change ALL the references to "Deleted User #" in the database to a new user account that I create to associate the posts with a new account (see above)

For example change all references to "Deleted User 473" to "John171"
without doing this on a post to post basis, which is tedious when the user had 1000+ posts.
 

THM

Aspirant
Joined
Aug 10, 2017
Messages
36
There's this add-on (XF 1.3, 1.4. and 1.5 compatible):
https://xenforo.com/community/resources/th-undelete-users.4865/

That addon worked nicely, but Themehouse doesn't plan a 2.0 version, and I am running 2.0.
Plus, as far as I can ascertain, in the database, the user is completely wiped clean and deleted, and nothing remains. What would have to be done would be as follows:

1. Make replacement user account
2. Get someone to write a custom MySQL script to link the threads to the new user account.
 
Top