Restore a Deleted User Account?

A user of mine who asked his account be deleted a year ago came to me last night and asked if his account could be restored. As far as I know, this is not possible.

I remember when I was using SMF there was a mysql command which made deleted user accounts "undelete" or more accurate a merge solution. Is there a similar way to accomplish that with xenforo?

You can try to assign back all the posts and threads that that particular user made with these queries:

For posts

Code:
UPDATE xf_post SET user_id = x WHERE username ='oldusername';

For threads

Code:
UPDATE xf_thread SET user_id = x WHERE username ='oldusername';

And replace x with that member new id and oldusername with their old username

Then you might need to run the Rebuild Caches option at your acp. Hope it helps.

You can also try to get thier old pm''s back with running a few extra queries but personally I don't have much free time to look into that now.
 
You can try to assign back all the posts and threads that that particular user made with these queries:

For posts

Code:
UPDATE xf_post SET user_id = x WHERE username ='oldusername';

For threads

Code:
UPDATE xf_thread SET user_id = x WHERE username ='oldusername';

And replace x with that member new id and oldusername with their old username

Then you might need to run the Rebuild Caches option at your acp. Hope it helps.

You can also try to get thier old pm''s back with running a few extra queries but personally I don't have much free time to look into that now.
Lifesaver!
 
You can try to assign back all the posts and threads that that particular user made with these queries:

Can that work if I have a user who wants to be deleted, but first I want to transfer some of their threads/posts into another current user ID, that we have for such emergencies :p

would it still be something like
Code:
UPDATE xf_post SET user_id = x WHERE username ='person-wanting-to-be-deleted';

so the person who wants to be deleted, their posts now go into user_id = x
 
  • Like
Reactions: DRE
Can that work if I have a user who wants to be deleted, but first I want to transfer some of their threads/posts into another current user ID, that we have for such emergencies :p

would it still be something like
Code:
UPDATE xf_post SET user_id = x WHERE username ='person-wanting-to-be-deleted';

so the person who wants to be deleted, their posts now go into user_id = x
Gonna test this out right now.
 
lol Accidentally deleted the other admin on my site. Oh man...

I feel like... Kier needs to make it so that 'delete user' is only available on one page and one page only.

I've never had this problem on vBulletin.
 
I'm pretty ecstatic about the two queries here, the threads and posts. Thank you all very much for that.

Just wondering if it's possibly to restore likes, using a technique such as this?
 
You can try to assign back all the posts and threads that that particular user made with these queries:

For posts

Code:
UPDATE xf_post SET user_id = x WHERE username ='oldusername';

For threads

Code:
UPDATE xf_thread SET user_id = x WHERE username ='oldusername';

And replace x with that member new id and oldusername with their old username

Then you might need to run the Rebuild Caches option at your acp. Hope it helps.

You can also try to get thier old pm''s back with running a few extra queries but personally I don't have much free time to look into that now.
May I know which part do I have to change other than the "oldusername" ?
 
Can that work if I have a user who wants to be deleted, but first I want to transfer some of their threads/posts into another current user ID, that we have for such emergencies :p


Wouldn't the easiest thing be to merely change the user name to something like ex-user123. Remove all personal details from the profile. If you then change the password and email, that will then to all intents and purposes no longer be the original user. You would have the choice of keeping all posts in place, deleting them or moving to an admin only storage bin forum.
 
Wouldn't the easiest thing be to merely change the user name to something like ex-user123. Remove all personal details from the profile. If you then change the password and email, that will then to all intents and purposes no longer be the original user. You would have the choice of keeping all posts in place, deleting them or moving to an admin only storage bin forum.
That's basically what I do if a user wants their account deleted, I no longer actually delete accounts.
 
Top Bottom