Announcement

Collapse
No announcement yet.

Import Users, Forums, Categories from Text file

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

  • Import Users, Forums, Categories from Text file

    I would like to import Users and an entire forum structure into the SQL database for vBulletin from a text file. The reason I need to be able to do this is because I'll be adding/deleting hundreds of users and forums twice a year in bulk.

    I have read some posts that say it is easy to import users (yet none of them cover how the encryption of the password works) but nothing about importing a forum structure.

    I see there are many scripts available to import from other forums, but why are there no scripts to import from simple formatted text files??

    Please help.

  • #2
    If you are completely tearing down the forum including all postings and all users, then I'd just do a MySQL dump of the forum except the templates, save it somewhere, then Mass Prune posts and users.

    You can take a snapshot of all the users by doing MySQL dumps (backups) of the entire user table.

    Comment


    • #3
      Rikku, the problem is that no one knows how these text files will be formatted.
      is it seperated with commas, newlines, pipes? If so how many.

      Where is the password stored, is it on the same line as the username but seperated by another delimeter?

      The possibilities are endless hence why there is no from file importer.

      If you can post a small sample then I'll try and help you with a script.
      Scott MacVicar

      My Blog | Twitter

      Comment


      • #4
        Formatting isn't a problem. A text file can easily be modified, arranged and formatted by a simple programs - I haven't yet outputted the text files; they can be formatted in any way needed.

        If you were to write an import script that required the data to be formatted a certain way (eg. comma delimited, with the fields to be imported in a certain order) then one could create a text file that fits those constraints.

        For my specific needs, I would just like to import a list of users and passwords as well as a forum structure (forums, categories, subforums).

        If you designed a standard set of import requirements and documented them, I could easily build a few text files to take advantage of your scripts.

        I really appreciate your willingness to help me out. If you would like me to lock down the format of my text files instead of creating a general text import script, I would be more than willing to do so. I just thought that the availability of a general import script for text files would benefit a bunch of people since text files can be pretty easily manipulated to fit any requirements.


        Originally posted by Scott MacVicar
        Rikku, the problem is that no one knows how these text files will be formatted.
        is it seperated with commas, newlines, pipes? If so how many.

        Where is the password stored, is it on the same line as the username but seperated by another delimeter?

        The possibilities are endless hence why there is no from file importer.

        If you can post a small sample then I'll try and help you with a script.

        Comment


        • #5
          In my opinion, you would be better off using the structure of a standard sql file - ie. mysql queries, rather than creating a separate script for this, but it depends on your needs.
          http://www.ffdiscovery.com/archives/...very_vborg.gif

          Comment


          • #6
            Originally posted by rake
            In my opinion, you would be better off using the structure of a standard sql file - ie. mysql queries, rather than creating a separate script for this, but it depends on your needs.
            Sounds like a great idea. I would just need to know what the structure of the tables was and how to encrypt/hash a password so that I can insert it directly into the SQL table.

            And I would need the same for the forums structure - this looks like it might be a little more difficult because I would need to be able to setup a forum that multiple categories, forums, and sub-forums.

            Comment


            • #7
              You can export the forums and user tables and mimic the sql queries.

              As for passwords, i know there's a MD5() function in mysql but i've never used it. If that doesn't work, it can easily be done through a php file. You could even use vbulletin's global.php file.

              PHP Code:
              <?php
              require("./global.php");
              $DB_site->query("QUERY HERE");
              $DB_site->query("QUERY HERE");
              $DB_site->query("QUERY HERE");
              $DB_site->query("QUERY HERE");
              $DB_site->query("QUERY HERE");

              ?>
              http://www.ffdiscovery.com/archives/...very_vborg.gif

              Comment


              • #8
                Scott,

                Any ideas on a general user/forum import utility from a text file??

                I'm really in need of some specific examples... of how everything fits together. I guess if I need to just write my own scripts I can but I should be able to modify some prexisting code somehow if I know where to look. I've just never used vBulletin before....

                I like rakes idea of using SQL to import that data directly, but I still need to know HOW the data should be formatted?? I mean how are the tables set up? What field is what? How do I hash the passwords???

                How do I insert data correctly into an SQL table to create forums, categories, and sub-forums? I can obviously look at the SQL tables to see their structure but I can't figure out how to import the data correctly without some ideas/help/documentation!!

                Thanks!!!!

                Comment

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