Skip to:

BP Import Blog Activity

  • Boone Gorges


    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: Please use it at your own risk!

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

  • 5887735

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

    Boone Gorges


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


    Thanks, can’t wait!



    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




    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)
  • The topic ‘BP Import Blog Activity’ is closed to new replies.
Skip to toolbar