Exporting single user's posts to csv

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilfllc
    New Member
    • Nov 2014
    • 7
    • 5.1.x

    Exporting single user's posts to csv

    Hi, is it possible to export a single user's posts into csv or another format? Ideally I'd like to export all posts made by a specific user, along with date/time stamps and IP used at the time of posting. Just wondering if there's a query someone has used to accomplish this successfully in the past.

    Thanks!
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24358
    • 5.7.X

    #2
    All the data you're looking for is held in the 'node' table in the database (username, post text, IP address, timestamp) - you could simply query that from a backup (I'd use a backup instead of the live database for safety) in phpMyAdmin then export the results.
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • glennrocksvb
      Former vBulletin Developer
      • Mar 2011
      • 4021
      • 5.7.X

      #3
      'node' table only contains preview text. If the OP wants all the content then they have to join the 'text' table.

      Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

      Comment

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

        #4
        Your basic query will be:
        select n.*, t.* from `node` as n join `text` as t on (n.nodeid=t.nodeid) where n.userid=1 into outfile 'output.csv' fields terminated by ',' lines terminated by '\r\n'

        You can adjust the fields and the userid. Though if your server is secured in certain ways, this will fail.

        If you have remote access to the database, you can use MySQL Workbench to do this as well.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment

        • ilfllc
          New Member
          • Nov 2014
          • 7
          • 5.1.x

          #5
          Thanks very much, Wayne. I was able to piece it together from the sample query you provided.

          Cheers

          Comment

          • ilfllc
            New Member
            • Nov 2014
            • 7
            • 5.1.x

            #6
            Actually, I realized what I really need would be deleted posts by a specific user within a specific timeframe. Is that even possible? I'm not sure how long, or even if, vBulletin retains deleted posts.

            Thanks in advance!

            Comment

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

              #7
              You can run queries against the publishdate field in the node table to set a timeframe. This is a UNIX timestamp so if you need to manipulate it, you would have to use the date time functions in MySQL.

              "Soft" deleted posts are not actually deleted from the database. Permanently deleted posts are removed immediately.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment


              • ilfllc
                ilfllc commented
                Editing a comment
                Thanks again, Wayne.

            Related Topics

            Collapse

            Working...