Skip to:

Importing problem Example.php

  • evildrome


    Wordpress 4.9.6
    bbPress 2.5.14

    Hi All,

    I have a forum in SQLITE format and I want to import it into bbPress.

    I decided that if I was going to have to convert to a MYSQL database, I might as well use the schema indicated in Example.php

    As I didn’t *actually* have the schema, I had to *guess* based on the fields in Example.php

    For example:

    CREATE TABLE IF NOT EXISTS forums_table (

    _bbp_old_forum_id int(10) NOT NULL default 0,

    the_parent_id int(10) NOT NULL default 0,

    the_topic_count int(10) NOT NULL default 0,

    the_reply_count int(10) NOT NULL default 0,

    the_total_topic_count int(10) NOT NULL default 0,

    the_total_reply_count int(10) NOT NULL default 0,

    the_forum_title varchar(150) NOT NULL default ‘ ‘,

    the_forum_slug varchar(255) NOT NULL default ‘ ‘,

    the_forum_description text NOT NULL,

    the_forum_order int(10) NOT NULL default 0,

    the_forum_type int(10) NOT NULL default 0,

    the_forum_status int(10) NOT NULL default 0


    Having created the database as it is in Example.php, all I needed to do was load the MYSQL database from my SQLITE database.

    Job done!

    Yeah? Not so fast…

    The import fails here:

    SELECT convert(topics_table.the_topic_id USING “utf8mb4”)
    AS the_topic_id,convert(topics_table.the_topic_reply_count USING “utf8mb4”)
    AS the_topic_reply_count,convert(topics_table.the_total_topic_reply_count USING “utf8mb4”)
    AS the_total_topic_reply_count,convert(topics_table.the_topic_parent_forum_id USING “utf8mb4”)
    AS the_topic_parent_forum_id,convert(topics_table.the_topic_author_id USING “utf8mb4”)
    AS the_topic_author_id,convert(topics_table.the_topic_author_ip_address USING “utf8mb4”)
    AS the_topic_author_ip_address,convert(topics_table.the_topic_content USING “utf8mb4”)
    AS the_topic_content,convert(topics_table.the_topic_title USING “utf8mb4”)
    AS the_topic_title,convert(topics_table.the_topic_slug USING “utf8mb4”)
    AS the_topic_slug,convert(topics_table.the_topic_sticky_status USING “utf8mb4”)
    AS the_topic_sticky_status,convert(topics_table.the_topic_creation_date USING “utf8mb4”)
    AS the_topic_creation_date,convert(topics_table.the_topic_modified_date USING “utf8mb4”)
    AS the_topic_modified_date,convert(replies_table.the_topic_id USING “utf8mb4”)
    AS the_topic_id FROM topics_table AS topics_table INNER JOIN replies_table
    AS replies_table USING replies_table.the_topic_id = topics_table.the_topic_id WHERE forums_table.the_topic_id = 0 LIMIT 0, 100

    Lookee thar… a mystery field!


    Are there any other mandatory fields in the import schema that are not referenced in Example.php?

    And… what field from my database should I load to forums_table.the_topic_id ?


Viewing 5 replies - 1 through 5 (of 5 total)
  • Checkout the phpBB converter, it’s one of the best example implementations.

    Use _bbp_old_topic_id to grab your old topic id:

    p.s. The above phpBB converter uses bbPress 2.6 alpha which has many new refinements for the importer over bbPress 2.5, I’d suggest you use bbPress 2.6 alpha for any imports due to those improvements, it can be found here ( and both use bbPress 2.6)



    Hi Stephen,

    Thanks for getting back to me.

    I thought the relationship was:

    Forum can have many Topics

    Topic can have many Replies

    I was expecting to write one forum_table entry… for the forum.

    I’m not expecting to write multiple forum_table entries, one per topic, as the existence of a field forum_table.topic_id would seem to suggest.



    Hi Stephen,

    I will try the new version 2.6





    Hmmm… this error from class-bbp-converter-base.php seems never to be shown:

    // Connection failed
    if ( ! $this->opdb->db_connect( false ) ) {
    $error = new WP_Error( ‘bbp_converter_db_connection_failed’, esc_html__( ‘Database connection failed.’, ‘bbpress’ ) );
    wp_send_json_error( $error );

    You can leave all the database fields blank or enter rubbish and it still says:


    Starting Import…

    Ready to go.

    Which leads me to wonder, what other informational/error messages are not shown.



    >>Lookee thar… a mystery field!

    How did you get to “see” that SQL statement that failed?

    I too am having forum import issues and would like to know how you are debugging.

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