Announcement

Collapse
No announcement yet.

Custom Imports, Any Experience?

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

  • Custom Imports, Any Experience?

    Hi everyone,

    I'm a newbie to the php and vbulletin world. I sent an email to customer support by they said they don't support custom importing so I thought I would try here. This is the email I wrote, if anyone has any suggestions, I would greatly appreciate it, thanks!


    Hello,

    We recently purchased the vbulletin package and are in process of migrating data to the mySQL database we’ve created. I’ve been able to install the application and set up the database just fine, everything in that regard was pretty simple. I am running across a road block however during the data import process. I am writing the import script myself as we’re migrating from a custom in-house system. The problem I’m experiencing is with the forum table. I want to build a script that simply runs once we move this over to a live server, one of the steps I would like to avoid is setting up the forums through the admin panel and just doing it programmatically through my import script. I’ve updated the forum table with the forums we are going to create but I can’t get them to populate on the web page unless I create them in the Admin panel utility. I’ve done several test through the admin panel and created dummy forums to see what data is inserted into the forum table. This is an example of my import into the forum table:


    lcInsertString = [INSERT INTO Forum ] + ;

    [(] + [forumid, styleid, title, title_clean, ] + ;
    [description, description_clean, options, displayorder, replycount, ] + ;
    [lastpost, lastposter, lastthread, lastthreadid, ] + ;
    [lasticonid, threadcount, daysprune, newpostemail, newthreademail, parentid,] + ;
    [parentlist, password, link, childlist] + [)] + ;


    [ Values ] + ;

    [(] + lcMappedForumID + ; && forumid
    [, ] + '0' + ; && styleid
    [, ] + ['] + STRTRAN(NVL(lcTitle,''),['],['']) + ['] + ; && title
    [, ] + ['] + STRTRAN(NVL(lcTitle,''),['],['']) + ['] + ; && title_clean
    [, ] + ['] + STRTRAN(NVL(lcDescription ,''),['],['']) + ['] + ; && description
    [, ] + ['] + STRTRAN(NVL(lcDescription ,''),['],['']) + ['] + ; && description_clean
    [, ] + lcOptions + ; && options
    [, ] + '1' + ; && displayorder
    [, ] + lstr(lnTotalReplies) + ; && replycount
    [, ] + lnLastPostDate + ; && lastpost
    [, ] + ['] + STRTRAN(NVL(lcLastPostName,''),['],['']) + ['] + ; && lastposter
    [, ] + ['] + STRTRAN(NVL(ALLTRIM(topic.subject),''),['],['']) + ['] + ; && lastthread
    [, ] + lstr(topic.vbullID) + ; && lastthreadid
    [, ] + '0' + ; && lasticonid
    [, ] + lstr(lnTotalThreads) + ; && threadcount
    [, ] + '-1' + ; && daysprune
    [, ] + ['] + ['] + ; && newpostemail
    [, ] + ['] + ['] + ; && newthreademail
    [, ] + ['] + lcParentID + ['] +; && parentid
    [, ] + ['] + lcParentList + ['] + ; && parentlist
    [, ] + ['] + ['] + ; && password
    [, ] + ['] + ['] + ; && link
    [, ] + ['] + lcChildList + ['] + [)] && childlist




    As you can see, the fields I’m defaulting are styleid (‘0’), displayorder (‘1’), lasticonid (‘0’), daysprune (‘-1’), newpostemail (‘’), newthreademail(‘’), password(‘’) and link (‘’). All the other fields are being updated through variables that are predefined. Once I update the the forums table, the data looks good and it’s the exact same data that’s in the table when I create it manually through the Admin panel. Is there another table I’m missing? Do you have any suggestions as to why the forums don’t populate on the web page unless they are created through the Admin panel? Your help is greatly appreciated. Thank you

  • #2
    The dependencies between the tables and extra data and permissions that needs to be added is what's going on, personally I would advise copying a ImpEx system like wBB.

    Then use of import_forum() etc, takes care of all that.

    Here is how you can do users :

    http://www.vbulletin.com/forum/showp...85&postcount=3
    I wrote ImpEx.

    Blog | Me

    Comment


    • #3
      Jerry,

      Thanks for the reply. I've gone through some of the import files such as ImpexDatabase.php and ImpexDatabase_309.php and looked at the import_forum function. It seems to me (I'm not familiar with PHP syntax) that the code is the same. I don't see any inserts into other tables or any dependencies set outside of the update parentlist statement, which sets child/parent relationships between forums. I'm updating the parentlist value in my import script (copied exactly how the Admin panel sets them) so I'm not sure if that's the problem. In your post, you mentioned "dependencies between the tables." Are you saying that there must be corresponding data inserted into a table outside of the forum table?


      - Rich

      Comment


      • #4
        Originally posted by rreed
        Jerry,

        Thanks for the reply. I've gone through some of the import files such as ImpexDatabase.php and ImpexDatabase_309.php and looked at the import_forum function. It seems to me (I'm not familiar with PHP syntax) that the code is the same. I don't see any inserts into other tables or any dependencies set outside of the update parentlist statement, which sets child/parent relationships between forums. I'm updating the parentlist value in my import script (copied exactly how the Admin panel sets them) so I'm not sure if that's the problem. In your post, you mentioned "dependencies between the tables." Are you saying that there must be corresponding data inserted into a table outside of the forum table?


        - Rich
        I wrote ImpEx to protect people from having to hack the database, if you want to do direct inserts into the database I can't help you.

        I would advise against trying to take code from the core of ImpEx and focus on a module, and copy/modify it for your own use.
        I wrote ImpEx.

        Blog | Me

        Comment

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