Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Import – how to skip fields that don’t apply


  • licondam
    Participant

    @licondam

    Hi there!

    We’re trying to move our forums from a custom Q&A platform to bbPress… very glad there is now an importer!

    So I copied example.php to myimport.php, changed the class name, and updated the tables/columns that apply (the ones that exist in the old database).

    And ran the import…

    But I keep running into import errors for fields that don’t apply as they don’t exist in the other database, like forums_table.the_reply_count

    So for a field that just does not exist in the old database, what’s the proper syntax for “ignore this”? 🙂

    For example, this one…

    // Forum topic count (Stored in postmeta)
    $this->field_map[] = array(
    ‘from_tablename’ => ‘forums_table’,
    ‘from_fieldname’ => ‘the_topic_count’,
    ‘to_type’ => ‘forum’,
    ‘to_fieldname’ => ‘_bbp_topic_count’
    );
    I looked for this on the importer codex page, but just don’t see it.

    Thanks!
    LICON

Viewing 1 replies (of 1 total)

  • Robin W
    Moderator

    @robin-w

    change this to

    /*
    // Forum topic count (Stored in postmeta)
    $this->field_map[] = array(
    ‘from_tablename’ => ‘forums_table’,
    ‘from_fieldname’ => ‘the_topic_count’,
    ‘to_type’ => ‘forum’,
    ‘to_fieldname’ => ‘_bbp_topic_count’
    );
    */
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar