News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Change the name on posts for a deleted member account.

Started by kitz, March 16, 2016, 06:06:21 PM

Previous topic - Next topic

kitz

Hi I wonder if anyone can help please.   A member recently wished for all his account to be deleted and Ive done this.

However I now notice that all his posts of which there are a few thousand are still attributed to his old membername.  I was mistakenly under the impression that they would be attributed to 'guest' or something like 'anonymous'.

Looking in the database it would appear that his posts are attributed to id_member = 0.  With hindsight it would have perhaps been a good idea to change his username before deletion but its too late as I didnt realise it would still show his old member name..  so now I need to run some sort of query on the database.

Please be gentle with me here -  I never go into the SMF database because Im too scared of mucking something up...   but after scratching my head and realising that smf_members.member_name and smf_members. real_name have nothing to do with the smf_messages table and trying to work out what is going on.

Using id_member = 0 wont work because it appears there's some 'Anonymous' which probably date back to long ago SMF1 days...  and several hundred posts that arent his.



However would running something like the following work.    Would it affect anything else?

UPDATE `smf_messages`
SET  `smf_messages`.`poster_name` = "guest"
WHERE `smf_messages`.`poster_name` = "oldname"


Is there a chance anything could go wrong.  The forum is >10yrs old so the database is quite large and I really dont want to mess anything I shouldnt. 

JBlaze

Depending on how many posts your forum has, that query could take a long time to run and could bottleneck things for a bit. But to answer your question, yes that is the correct query to use, and no it won't harm anything.

Mind if I ask how many posts you have in your forum?
Jason Clemons
Former Team Member 2009 - 2012

kitz

Hi JBlaze - thank you for the prompt reply

311871 Posts in 14299 Topics

JBlaze

Shouldn't be too much of a problem then. I strongly suggest making a database backup beforehand, and also placing your forum in maintenance mode while it runs.
Jason Clemons
Former Team Member 2009 - 2012

kitz

OK - I shall do that.   Thank you vm for your help.

kitz


Advertisement: