Notifications
Clear all

Script [Solved] Restore a Deleted Members Account

21 Posts
3 Users
2 Reactions
707 Views
Posts: 1212
Topic starter
(@percysgrowroom)
Noble Member
Joined: 6 years ago

One of my members accidently deleted their account. The posts on the forum still exist but under name "Anonymous 12345"

The member in questions has resigned up, am I able to add the posts by the old account to the new account? I would like to get this fixed if at all possible. 

Any suggestions?

20 Replies
Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @percysgrowroom,

1. Let him register again and provide find the new userid

2. Open phpMyAdmin plugin or use the same tool in your hosting service

3. Select your database and open all tables

4. Navigate to the SQL Tab, change the red marked values to correct vales using the instruction below and execute these SQLs:

  • wp_ : should be changed to your table prefix
  • 9999 : should be changed to the new user id
  • Anonymous 12345 : should be changed to current display name of the deleted user.
UPDATE `wp_wpforo_posts` SET `userid` = 9999, `email` = '' WHERE `name` = 'Anonymous 1234' AND `userid` = 0;

UPDATE `wp_wpforo_topics` SET `userid` = 9999, `email` = '' WHERE `name` = 'Anonymous 1234' AND `userid` = 0;

5. Navigate to wpForo > Overview admin page, scroll down, find the [Delete All Caches] button, and click it.

Reply
1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

As a prevention of deleting own account you can disable that button using this instruction:

https://wpforo.com/community/postid/116980/

Reply
Posts: 1212
Topic starter
(@percysgrowroom)
Noble Member
Joined: 6 years ago

Thanks Robert, this sounds a little complicated but ill give it a shot. How do I  find Anonymous 12345 in the table? 

Reply
1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

@percysgrowroom,

You don't need to find it in the database, you see it on posts. So just change the 1234 to the real numbers you see.

Reply
Posts: 1212
Topic starter
(@percysgrowroom)
Noble Member
Joined: 6 years ago

Yer this is complicated lol, I dont know what databases to open, what tables, nothing like that and I dont want to break anything. Would it be possible for you to go into more detail with this please mate? 

The user ID in questions is: 13186

Reply
1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

@percysgrowroom,

I'm sorry but we cannot do that. It's very clear explained. Just backup your database and to the steps I described.

Reply
Posts: 1212
Topic starter
(@percysgrowroom)
Noble Member
Joined: 6 years ago

Oh and can I do this with their likes too?

Reply
6 Replies
RealAct
(@realact)
Joined: 7 years ago

Reputable Member
Posts: 238

@percysgrowroom did you fix it? I can try to help you fix it and guide you, but you must first do a full backup of your site just in case.

What does your host use for your account? cPanel or what?

Reply
(@percysgrowroom)
Joined: 6 years ago

Noble Member
Posts: 1212

@realact I just did a full back up and are going to try it now mate. I will let you know how it goes 🙂 

 

Reply
(@percysgrowroom)
Joined: 6 years ago

Noble Member
Posts: 1212

@realact I think this is too risky and could do with some extra help if you dont mind mate. My host uses Cpanel

Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

@percysgrowroom,

There is no any risk here. If the "Anonymous 1234" is set correctly then all will be fine, it's not set correctly then nothing will be changed. So please move forward and do that without any worry. Just copy and use the Anonymous user name you see on his/her posts.

Reply
(@percysgrowroom)
Joined: 6 years ago

Noble Member
Posts: 1212

@robert Thanks Robert, I appreciate you clearing that up for me mate 🙂

Reply
RealAct
(@realact)
Joined: 7 years ago

Reputable Member
Posts: 238

@percysgrowroom send me PM on your forum with some info where we could chat live. My username on your forum is @eli

Reply
Page 1 / 2