PDA

View Full Version : Restore Deleted User


dataman
12-17-2008, 05:46 PM
Last night a member was deleted via ACP. Since then, we've reconciled and I tried to add the user back.
I went to the last good database backup, and found the SQL command to insert the USER row. I edited it to make sure it would insert only the one user, and copied it into PHP_MYADMIN. I ran the SQL and it inserted the USER record just fine. The user is now able to log in to our forum just fine.
The problem is, all past posts are showing 'guest' next to her name. Also, in ACP, the user is showing in user lists, but when I hover over the name, the action string at the bottom shows 'u=' where it should be 'u=10'.
Yes, her userid field in the USER table shows 10.
How do I fix this?

Lynne
12-17-2008, 06:08 PM
Users are added in more than just the user table. I think there are two other tables they use - userfield and usertextfield.

dataman
12-17-2008, 06:31 PM
Lynne,
You rock!!!!!! That did it. I simply inserted rows in those 2 tables and all is fixed. Thanks!!!!

USAMustangs.com
06-21-2009, 05:55 AM
Could someone write out a simplified step by step on this? I have the same issue.

Lynne
06-21-2009, 03:02 PM
Could someone write out a simplified step by step on this? I have the same issue.
There are many posts over on vb.com dealing with running a query to change 'guest' posts back to user posts. They have step-by-step instructions over there.

USAMustangs.com
06-21-2009, 10:03 PM
There are many posts over on vb.com dealing with running a query to change 'guest' posts back to user posts. They have step-by-step instructions over there.

Thanks for the suggestion.

I found this thread http://www.vbulletin.com/forum/showthread.php?t=282868

And I just wanted to confirm that there is no way to restore a deleted user? And that you have to recreate the user then use the suggested steps to transfer the post count to recreated user?

I just wanted be sure before I attempted it. If someone could let me know I sure would appreciate it.

Thanks.

Lynne
06-22-2009, 03:40 AM
Thanks for the suggestion.

I found this thread http://www.vbulletin.com/forum/showthread.php?t=282868

And I just wanted to confirm that there is no way to restore a deleted user? And that you have to recreate the user then use the suggested steps to transfer the post count to recreated user?

I just wanted be sure before I attempted it. If someone could let me know I sure would appreciate it.

Thanks.
Correct - there is no way to restore a deleted user. You should do what Steve suggested in that thread.

Aclikyano
06-22-2009, 06:20 PM
oh good thing 4 ya backup, thats alot of trouble 2 go thru for a deleted member lol
i woulda told em too late, make a new name....but i never delete users like that

Carnage
06-23-2009, 12:06 PM
I wrote a member undeleter script for vb 3... we had an admin back then who accidentally deleted a few users. Doubt it'd still work for 3.8 esp as it was based off code for vb2 which was used to change someones userid.

I did notice this: https://vborg.vbsupport.ru/showthread.php?t=147378 in the similar threads box thou

bulbasnore
08-04-2011, 03:06 AM
grep'd the insert commands for the numeric userid out of the backups of

user
userfield
usertextfield

If you don't know how to do that, without further explanation, you are in danger of wrecking your database, so instead make a new user though admincp for this person.

Either way, at this point you now have a new user with a numeric userid, so follow this query:

UPDATE post SET userid='newusersid' WHERE username='exusername';

newuserid is the numeric userid of the user
exusername is the EXACT string for the deleted user's username