Skip to:
Content
Pages
Categories
Search
Top
Bottom

Importing messages into bbPress


  • itayasa
    Participant

    @itayasa

    Hi.
    I have an XML file containing messages (title, date, author and body). I’ve considered three methods of importing these messages into bbPress:

    1. Into the database. I’ve written a PHP script to automate that but because the messages are in Hebrew then the encoding causes the text to be gibberish. When that problem was solved, topics that were inseted into the wp_posts table didn’t appear in the forum page.

    2. Using the custom importing method. The database structure required to import the messages isn’t really understandable, how should my database be organized in order to transition my data from one database into WordPress’?

    3. Using POST requests. I managed to parse the POST request the posting form does in order to make requests of my own. This is complicated, however, due to use of session cookies.

    Right now the option that seems the best to me is (2). Instead of messing with encoding issues or session cookies, I need to create a second database but the question is: in which way should my data be organized? How are the IDs working? I didn’t really manage to catch all of that using the docs available here.

Viewing 5 replies - 1 through 5 (of 5 total)

  • Robin W
    Moderator

    @robin-w

    with option 1, what did you put as post parent for each topic?


    itayasa
    Participant

    @itayasa

    I used the ID field of the parent topic (in table wp_posts).
    I suspect that I’ll have to mess with the wp_postmeta table as well (though at first I didn’t see a direct connection to the messages not appearing on the forum).


    Robin W
    Moderator

    @robin-w

    The parent ID should be the forum the topic belongs to.

    If that doesn’t fix suggest you try running the forum tools to get the relationships right

    dashboard>tools>forums>repair forums

    and run one at a time

    That may get you further forward


    itayasa
    Participant

    @itayasa

    The parent ID value was okay.
    Running the repair tool didn’t help.
    Isn’t there an API to help with the issue I’m having?


    itayasa
    Participant

    @itayasa

    I successfully managed to post messages into the forum by including WordPress in my php script and calling bbp_insert_topic.
    However, it seems like when I call bbp_insert_reply bbPress actually inserts a topic parented to another topic and these appear like replies in the site itself.
    Tried repairing the forums and it didn’t work.
    Any idea why?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar