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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avega
    New Member
    • May 2007
    • 12
    • 3.5.x

    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)

  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73976

    #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 demonstration site.
    vBulletin 5 API

    Comment

    • avega
      New Member
      • May 2007
      • 12
      • 3.5.x

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

      Comment

      • avega
        New Member
        • May 2007
        • 12
        • 3.5.x

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

        Comment

        • avega
          New Member
          • May 2007
          • 12
          • 3.5.x

          #5
          Originally posted by avega
          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

          • Mark.B
            vBulletin Support
            • Feb 2004
            • 24286
            • 6.0.X

            #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
            ------------
            My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
            My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

            Comment

            • Raptor
              Senior Member
              • Jan 2001
              • 224
              • 4.2.x

              #7
              Originally posted by avega
              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.
            • Raptor
              Senior Member
              • Jan 2001
              • 224
              • 4.2.x

              #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

              • Mark.B
                vBulletin Support
                • Feb 2004
                • 24286
                • 6.0.X

                #9
                Originally posted by Raptor
                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
                ------------
                My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                Comment

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