member deleted their account how do i restore it???

Started by 65stang, July 04, 2004, 02:29:20 PM

Previous topic - Next topic

65stang

a member deleted their account due to another member, im getting it straightened out so I will need to restore this members information, is there a way to do this or do they have to reregister???

Grudge

#1
They will have to register I'm afraid. You can however attribute all their posts back to them with a SQL command. When they reregister find out their ID_MEMBER and then run a query like this:

UPDATE smf_messages SET ID_MEMBER = *THEIR_ID_MEMBER_HERE* WHERE posterEmail = '*THEIR OLD EMAIL ADDRESS*'
I'm only a half geek really...

Alisha

Would it be correct to assume that would work to combine 2 accounts?

Older and new account? Saying someone forgot their password, so they made a new account? I could use this to combine the new messages with the old account and then delete the newaccount?

Grudge

yes. to do that I'd probably just reattribute them by member ID.

i.e
UPDATE smf_messages set ID_MEMBER = *ID YOU WANT TO KEEP* WHERE ID_MEMBER = *ID YOU WANT TO DESTROY*
I'm only a half geek really...

Alisha


65stang

Quote from: Grudge on July 04, 2004, 02:50:43 PM
They will have to register I'm afraid. You can however attribute all their posts back to them with a SQL command. When they reregister find out their ID_MEMBER and then run a query like this:

UPDATE smf_messages SET ID_MEMBER = *THEIR_ID_MEMBER_HERE* WHERE posterEmail = '*THEIR OLD EMAIL ADDRESS*'

i tried this, problem is, their new email addy is the same as their old addy

Grudge

That should still work fine. Can you post the EXACT version of the query you used. That will only restore the posts back to them - not their post count. You could then get their post count correct by doing these two queries:
SELECT COUNT(ID_MSG) FROM smf_messages WHERE posterEmail = 'THEIR_EMAIL'

and note down that result...

then do this:
UPDATE smf_members SET posts = THAT_NUMBER WHERE ID_MEMBER = THEIR_ID_MEMBER_HERE
I'm only a half geek really...

65stang

Quote from: Grudge on July 15, 2004, 04:08:29 AM
That should still work fine. Can you post the EXACT version of the query you used. That will only restore the posts back to them - not their post count. You could then get their post count correct by doing these two queries:
SELECT COUNT(ID_MSG) FROM smf_messages WHERE posterEmail = 'THEIR_EMAIL'

and note down that result...

then do this:
UPDATE smf_members SET posts = THAT_NUMBER WHERE ID_MEMBER = THEIR_ID_MEMBER_HERE

ya sure it looked like this

UPDATE smf_messages SET ID_MEMBER = 2052 WHERE posterEmail = '[email protected]'

Oldiesmann

I got it all straightened out. Not sure why those queries weren't working - when I tried to select messages where the postermail was their email, it kept coming up with only one message, so I finally just did this:

UPDATE smf_messages SET ID_MEMBER='THEIR_ID' WHERE postername='Them';

And it worked fine...

Vinoth

This thread must be made sticky, it is very use full indeed/
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

EG

Can I be completely thick, and ask where you use this command ?

UPDATE smf_messages SET ID_MEMBER = *THEIR_ID_MEMBER_HERE* WHERE posterEmail = '*THEIR OLD EMAIL ADDRESS*'

in phpmyadmin ???

Trekkie101

Click on the little white box that says "SQL" on your database and there will be a white text box to do it in.  ;)

EG

thanks!

YES! this definately ought to be stickied or FAQed or something!

I also found that...

UPDATE yabbse_messages SET ID_MEMBER = 'their_new_user_id'  WHERE posterName = '*theirusername*'

also restores all posts to the new user id with the old username.

Funnily enough just restoring the posts by email addie, restored just 10 posts.. where this method restored 451!

Serenity

i have used this

UPDATE smf_messages SET ID_MEMBER = 'their_new_user_id'  WHERE posterName = '*theirusername*'

but somehow i lost the topics tht were made by this user!!
::)

Oldiesmann

That's a bit trickier, but can still be done.

Upload the following to your forum directory and run it...

<?php
//Include SSI.php as a quick and dirty way to get access to all the stuff we need...
include_once('SSI.php');
//Get the ID_TOPIC values for the topics that need updating...
$query1 = db_query("SELECT t.ID_TOPIC, m.ID_MSG FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t WHERE t.ID_FIRST_MSG = m.ID_MSG AND m.ID_POSTER = 'their_new_user_id'", __FILE__, __LINE__);
//Do the updating
while($stuff = mysql_fetch_assoc($query1))
{
$query2 = db_query("UPDATE {$db_prefix}members SET ID_MEMBER_STARTED = 'their_new_user_id' WHERE ID_TOPIC = '$stuff[ID_TOPIC]'", __FILE__, __LINE__);
}
?>


After that, go to Admin -> Forum Maintenance and click on "Recount all forum totals and statistics" to update the stats for that member.

Elijah Bliss

Quote from: Grudge on July 04, 2004, 02:50:43 PM
They will have to register I'm afraid. You can however attribute all their posts back to them with a SQL command. When they reregister find out their ID_MEMBER and then run a query like this:

UPDATE smf_messages SET ID_MEMBER = *THEIR_ID_MEMBER_HERE* WHERE posterEmail = '*THEIR OLD EMAIL ADDRESS*'

Now I have a question, this happened to one of my members a couple of days ago, but I still have their member data recently backed up (the day before they were deleted), how would I restore their account with their member data?

[Unknown]

Just restore that row and only that row, and point things back to it.

-[Unknown]

Nitro

my problem is the account is deleted and it shows their old mmber name and under that, it shows 'guest' now, this member has craeated another account.
i noticed his old ID number is taking by a new member, and all of his topics shown as a guest with no email address whatsover.

how can i merge these 'guest' topics to his new account? i tried all these tips here and there and nothing works.

i appreciate your help, if any available. thank you!
MPF Rocks!!!

[Unknown]

There are topics already for this.

UPDATE smf_messages SET ID_MEMBER = *THEIR_ID_MEMBER_HERE* WHERE posterName = '*THEIR OLD AND/OR CURRENT USERNAME*';

-[Unknown]

Nitro

Quote from: Oldiesmann on July 15, 2004, 09:39:43 AM
I got it all straightened out. Not sure why those queries weren't working - when I tried to select messages where the postermail was their email, it kept coming up with only one message, so I finally just did this:

UPDATE smf_messages SET ID_MEMBER='THEIR_ID' WHERE postername='Them';

And it worked fine...

This Query worked GREAT!!!! i had my account deleted by ACCIDENT so it left my old user name with no email in it, below my old user name was the 'GUEST' tag. i had more than 1000 topics, so if you can imagine, WOW!!
so this is what i did

UPDATE smf_messages SET ID_MEMBER='my new ID' WHERE postername='old user name'

so IT WORKED!!! what i was doing, i used to 'modify' my old topics and i had to put the old email, and it was a pain! i used to run this other Query:
UPDATE smf_messages SET ID_MEMBER = 'my new Id number' WHERE posterEmail = 'my old email address' that worked too, but i knew it would take me forever.

GREAT THING you guys never delete these old topics..

THANK YOU GUYS!!!!!!
MPF Rocks!!!

Advertisement: