Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP Import Blog Activity

  • Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    I wrote an ugly, dirty utility today that goes through every blog post and comment on your installation of WP, checks to see if there’s a BP activity item corresponding to it, and creates an activity item if it doesn’t find one. The use case is for people who installed BP on an already-existing community of bloggers and want to import all preexisting comments and posts into activity streams.

    When I ran it on a large-ish database, I ran into some memory problems (no surprise there). I give some instructions on how to work around it in my post on the subject: http://teleogistic.net/code/buddypress/bp-import-blog-activity/ Please use it at your own risk!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of dennis_h
    Anonymous

    Is there a way to get this working with a single install of WP?

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Oho, that’s an interesting idea. I’ll try to alter it to work with single WP and post a link.

    Avatar of dennis_h
    Anonymous

    Thanks, can’t wait!

    Avatar of Magnes
    Magnes
    Participant

    @magnes

    I created a version of BP Import Blog Activity that works with single install of WP. It’s a simple hack:
    1) Change this lines:

    $query = “SELECT * FROM {$wpdb->blogs} WHERE site_id = ‘{$wpdb->siteid}’ “;
    $blog_list = $wpdb->get_results( $query, ARRAY_A );
    foreach( $blog_list as $blog ) {
    /*if ( $blog < 12 ) continue;
    if ( $blog > 30 ) die();*/
    switch_to_blog( $blog );

    2) TO this:

    {
    $blog = 1;

    3) And change

    query_posts(‘order=ASC’);

    To:

    query_posts(‘order=ASC&posts_per_page=500′);

    Otherwise it will end after first few posts. (you can change 500 to something larger or use paging to do the job in parts if you have a very large blog)

    Wonderful solution, but it only partially import comments and blog posts. When I try to hit the button again I did import a few more, but the third time I ended up with just this message and no import:

    Blog name: WordPress Dimensie

    Blog name: WordPress Dimensie

    Blog name: WordPress Dimensie
    Importing: ""
    Importing: ""
    Importing: ""

    Any clue as to what’s going on here? Because I’m stumped and I would appreciate any and all help :)
    Working with 3.1beta2 and BP 1.2.7 btw..

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

You must be logged in to reply to this topic.