Skip to:
Content
Pages
Categories
Search
Top
Bottom

Import BB data from CSV file to bbPress forum


  • harpeml
    Participant

    @harpeml

    Hello,

    I am new to the WordPress world and setting up my first experimental site inside my company. I want to move a blog/forum from an old home grown system to a new bbPress forum. I do not need to carry over replies; just the topics, write ups, author, and tags. I have all of the information in a spreadsheet. Assuming all of the old authors have accounts in the new WordPress, is there a way to import the topics and their metadata? I see importers for some specific BBs but nothing for just a generic data file.

    Thanks much for any suggestions,
    Mike Harper

Viewing 16 replies - 1 through 16 (of 16 total)
  • I hadn’t really thought about importing from CSV, until now.

    The importer included with bbPress is setup to only import from a MySQL database.

    We could create a guide to create a simple to database that you could import your CSV into and then bbPress import from that.

    Otherwise using the built in importer within WordPress (wp-admin -> tools -> import /wp-admin/import.php) there are some http://wordpress.org/plugins/search.php?q=CSV+importer CSV importers that might do the job. You could modify one of these to import the data instead of WordPress post type ‘post’ you would want your topics to use the ‘topic’ post type for bbPress (Forums are ‘forum’ and Replies are ‘reply’)

    Either of the ways above should be rather straight forward and I might take a look at few of those importers and fork one specifically for importing from CSV to bbPress in the future.


    sciman@csupomona.edu
    Participant

    @scimancsupomonaedu

    I would sure support this. I’m a newbie to WP and would like to use bbPress, but have a lot of old hypercard forum posts I’ve reduced to a Filemaker database. I have about 7 named forums, have authors and their post in date order. None need to be linked as replies. There’s tremendously valuable information on family histories in this archive that I’d dearly like to remain available for those interested. If I could get these posts to a forum, that would be extremely helpful.

    I’d highly suggest you take a look at some of these CSV importers that support ‘Custom Post Types’, I have had a quick look at a couple of them the other day and I am quite sure they will work fine to import into bbPress.

    It is just a matter of finding the one that suits you and your CSV data.


    harpeml
    Participant

    @harpeml

    Thank you for all the guidance Stephen. I appreciate the help.

    Cool :) Once you have tried them let me which one worked for you. If none work we will then look at forking one of them and writing a custom version for bbPress. If that doesn’t work we can come up with a custom CSV format to import directly into MySQL and then write an extension for the bbPress importer. In the end there will be a way. :)


    sciman@csupomona.edu
    Participant

    @scimancsupomonaedu

    This is terrific, though I suppose that I have to learn somehow the field names to be mapping my fields to. I’ve not actually installed the bbPress plug-in as yet. Does it work with the regular WP database, so that I import the ‘custom post type’ to a WP install, or does it get imported to bbPress itself. Boy am I dumb;-) But thanks Stephen — your responsiveness if super encouraging.


    harpeml
    Participant

    @harpeml

    Hi Again, I looked at the plug-ins and it seemed that WP Ultimate CSV Importer would do the job. I tried importing one of their example CSV files. It lets me choose the post type “forum” although I see no way to provide a forum title. It appeared to work with no errors. However, looks like it took each post entry and created a new Forum with it. I see no way to have the posts come in as topics under an existing or new Forum. Is there a way to change this once the import is done?

    Sorry I am not a PHP person and not familiar with the inner workings of WordPress.

    Firstly, thanks for looking further into this, it gave me enough info to run a quick test import.

    bbPress uses WordPress tables and doesn’t create any of its own and not having answers to something you don’t know doesn’t make anyone dumb. ;)

    Ok…. Here we go….

    I installed this plugin http://wordpress.org/plugins/wp-ultimate-csv-importer/

    I realised the csv file had to be split into 3, one for the forum, one for topics and one for replies. Here is a copy of the 3 CSV files I used https://gist.github.com/ntwb/6532360

    Next jump into WP Admin and and open up the WP CSV Tool and select ‘Custom Post’ to import from and select your forum.csv file to upload and click import.

    Set the options and field mappings as per this:

    Import Data Configuration

    Select Post Type = forum
    Import with post status = publish
    post_author = post_author
    post_date = post_date
    post_content = post_content
    post_title = post_title

    And click import.

    Topics is up next and you will notice that it includes the field ‘post_parent’ so this is the forum ID that the topic will be imported into. As we do not know the forum ID you will need to open up the bbPress forums panel in wp-admin. Select the forum you want the topics to be imported and this will take you into the forum edit section, look at the URL in your browser and it should be similar to /wp-admin/post.php?post=348830&action=edit what we want here is the ’348830′ as that will be the parent forum for each topic imported. Update your topic.csv file with this number as per my sample linked above.

    Back to the CSV importer to import your topics.csv

    Set the options and field mappings as per this:

    Import Data Configuration

    Select Post Type = topic
    Import with post status = publish
    post_author = post_author
    post_date = post_date
    post_content = post_content
    post_title = post_title
    post_parent = post_parent

    The replies section is basically the same as the topics section, you need to get the ID orf each topic ID for each reply and update your reply.csv file for each entry.

    Lastly run each of the ‘Recalculate’ and ‘Count’ bbPress ‘Repair Tools’ from wp-admin-> Tools- Forums -> Repair Forums (more info here http://codex.bbpress.org/repair-forums/)

    And I think that’s it, there is a bit of juggling your data around, give it a bash and let me know how it works out for you and here’s the result :)


    sciman@csupomona.edu
    Participant

    @scimancsupomonaedu

    One other question, Stephen. As I think through this, don’t I also somehow need to be concerned about getting my authors and perhaps their email addresses registered as members of the site or something? I’d imagine that that would need to be done first. Interestingly, as I look at the file data I have, the identified “author” sometimes has taken new names, and of course email addresses probably require updating. Do I need to assign passwords or something? I hope not, though I expect this depends on how I will choose to configure or reconfigure permissions for posting at the website? Again, thanks a million for any help.

    Ahhh… Yes… That would make sense, probably a dedicated ‘User CSV Import’ plugin eg. http://wordpress.org/plugins/search.php?q=csv+user plugin that matches your requirements.

    You shouldn’t have to assign passwords, users can do this themselves later.

    Once you have your users you will want to update your topic.csv & reply.csv files with the new user ID’s.


    harpeml
    Participant

    @harpeml

    Hello Stephen,

    I have a follow up question on the above topic. In the old BB we had each topic showed with a short summary field of the post content (usually just the first X characters of the content). Is there a way to do that with bbPress Forum topics? I do not see any existing widget that does this. In fact, is there even a field mapping for such a thing?

    thanks,
    Mike


    harpeml
    Participant

    @harpeml

    Oops, forgot another item. I want to bring in topic tags as well. How do I do that.

    thanks


    harpeml
    Participant

    @harpeml

    For example, when I go to the support forums for bbPress I see a widget on the left that lists links for tags that have appeared in the forums/posts. How would get that?

    Sorry about the multiple messages.

    I have a follow up question on the above topic. In the old BB we had each topic showed with a short summary field of the post content (usually just the first X characters of the content). Is there a way to do that with bbPress Forum topics? I do not see any existing widget that does this. In fact, is there even a field mapping for such a thing?

    In WordPress terms this is known as ‘the_excerpt’ and is a function that will only show ‘x’ words of a post, this is not something you can transfer, it is a ‘display’ function in WordPress.

    Oops, forgot another item. I want to bring in topic tags as well. How do I do that.

    These are a little tricky mainly because understanding how they are implemented in WordPress is not an easy task as they are distributed throughout three tables.

    Upload a csv file to http://gist.github.com or http://pastebin.com with a couple of examples of how your data currently has ‘tags’ associated to the topics and I will try to come up with something that is a little clearer than mud for you ;)


    harpeml
    Participant

    @harpeml

    Hi, the import went reasonably well for me. Thanks for all the guidance.

    I imported values for the “excerpt” field for each topic under a forum post. They do not seem to show up yet in the forum view. What can I do to have them display along with the topic titles in the view listing?

    Thanks

    You won’t need this text and/or value that you imported.

    You will have to create your own templates by copying bbPress templates to your theme directory:

    http://codex.bbpress.org/theme-compatibility/

    You would then use the_excerpt rather than the_content to output only ‘x’ words from each topic/reply

    http://codex.wordpress.org/Function_Reference/the_excerpt

    There are a few people who have played around using the_excerpt and bbPress, have a good look around the site to see how and what they did:

    http://bbpress.org/forums/search/the_excerpt/

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

You must be logged in to reply to this topic.