Group Mods

  • Profile picture of Hugo
  • Profile picture of r-a-y
  • Profile picture of @mercime

BP Import Blog Activity (6 posts)

Started 2 years, 2 months ago by: Boone Gorges

  • Profile picture of Boone Gorges Boone Gorges said 2 years, 2 months ago:

    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!

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

  • Profile picture of Boone Gorges Boone Gorges said 2 years, 2 months ago:

    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!

  • Profile picture of Magnes Magnes said 1 year, 8 months ago:

    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['blog_id'] 30 ) die();*/
    switch_to_blog( $blog['blog_id'] );

    2) TO this:

    {
    $blog['blog_id'] = 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)

  • Profile picture of Remkus de Vries Remkus de Vries said 1 year, 5 months ago:

    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..