• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Restore a Deleted User Account?

borbole

Well-known member
#3
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.
 

DRE

Well-known member
#10
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!
 

D.O.A.

Well-known member
#11
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
 

DRE

Well-known member
#12
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.
 

DRE

Well-known member
#15
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.
 
#16
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?
 

clove28

Active member
#17
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" ?
 

Mr Lucky

Well-known member
#19
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.
 

Martok

Well-known member
#20
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.