Announcement

Collapse
No announcement yet.

How to undelete a user or restore the posts for a user that was deleted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to undelete a user or restore the posts for a user that was deleted

    An administrator deleted a user with lots of posts by mistake.

    Is there a way to restore the user and all the posts? (all messages were sent to the generic "Guest" user)


  • #2
    You cannot undelete a user. You would have to create a new user.

    If you don't let guest users post, you can re-assign the posts to this new user using a SQL query like "UPDATE node set userid=XXX where userid=0;" XXX would be the userid of the new user. Though, I recommend making a complete database backup before doing this.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.

    Comment


    • #3
      Wayne you are a lifesaver, it worked great!

      Comment


      • #4
        The same deleted (now undeleted) user lost his avatar. Do you know a way to restore or get the .gif from somewhere?

        Comment


        • #5
          Originally posted by avega View Post
          Wayne you are a lifesaver, it worked great!
          I just noticed that in the forum and searches some topics still say that it was initiated by 'Guest' is there a maintenance tool to update this?

          If I hover over 'Guest' the profile link is http://www.exampleurl.com/forum/member/10196-guest

          how to change the 10196-guest to the real nickname?

          Comment


          • #6
            You have to remember you haven't "undeleted" the user, you have recreated it from scratch. You will need to manually upload any avatar or other profile elements, as these no longer exist.

            Updating the topic and forum counters and clearing the system cache should make the correct user show, if you've done it correctly.
            MARK.B | vBULLETIN SUPPORT

            TalkNewsUK - My vBulletin 5.5.4 Demo
            AdminAmmo - My Cloud Demo

            Comment


            • #7
              Originally posted by avega View Post
              An administrator deleted a user with lots of posts by mistake.

              Is there a way to restore the user and all the posts? (all messages were sent to the generic "Guest" user)
              Simple fix. Create a new account then run this query.

              update post set userid="new_userid" where username="old_username"

              I'm sure there may be more areas to update but this will at least put the posts under an account you can manage.
              Digital-Forums: www.digital-forums.com | CK3 Games: www.ck3.co.uk

              Comment


              • Wayne Luke
                Wayne Luke commented
                Editing a comment
                vBulletin 5 does not have a "post" table. The solution in post #2 is the correct one for vBulletin 5.

            • #8
              My solution was for vb4. Worked great. Apologies for not specifying.
              Digital-Forums: www.digital-forums.com | CK3 Games: www.ck3.co.uk

              Comment


              • #9
                Originally posted by Raptor View Post
                My solution was for vb4. Worked great. Apologies for not specifying.
                No problem, but please be conscious that the question was posted in the vBulletin 5 support forum. No solutions for vBulletin 4 will apply here. In some cases (admittedly not this one) users could damage their databases running vB 4 queries on vB 5. At best they will get a nasty error which can panic some people and push them into unnecessary remedial actions. Iíve seen sites completely wrecked through this sort of thing.
                MARK.B | vBULLETIN SUPPORT

                TalkNewsUK - My vBulletin 5.5.4 Demo
                AdminAmmo - My Cloud Demo

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X