How to make shure... we connected to new (created) DB's or still connected to old DB

We install Multi-DB plugin... create new (256) DB's... Use online software to move DB's...

How to confirm: we are using now new(256) DB's or still connected to old DB?

Can we have more details about how to install new mu plug-ins, and what we need to add into config file???

Thank you!

  • Aaron

    Or plugins here either list the global tables in the install.txt, or you can get them from the sql.txt we always include if there are any tables for that plugin. For example here is Anti-Splog:

    Global Tables for Multi-DB db-config.php: (if you use Multi-DB)
    ----------------------------------------------------------------------
    wp_ust

    Here is Supporter:

    Global Tables for Multi-DB db-config.php: (if you use Multi-DB)
    ----------------------------------------------------------------------
    wp_supporters
    wp_supporter_signup_stats
    wp_supporter_daily_stats
    wp_supporter_ads

    You should remove the wp_ prefixes.

  • bdonaghy

    We have this info in db-config.php for global tables ...

    add_global_table(‘as_appointments’);
    add_global_table(‘as_open_schedules’);
    add_global_table(‘as_schedules’);
    add_global_table(‘commentmeta’);
    add_global_table(‘comments’);
    add_global_table(‘leaguemanager_leagues’);
    add_global_table(‘leaguemanager_matches’);
    add_global_table(‘leaguemanager_stats’);
    add_global_table(‘leaguemanager_teams’);
    add_global_table(‘links’);
    add_global_table(‘mrt_sms_list’);
    add_global_table(‘ngg_album’);
    add_global_table(‘ngg_gallery’);
    add_global_table(‘ngg_pictures’);
    add_global_table(‘options’);
    add_global_table(‘postmeta’);
    add_global_table(‘posts’);
    add_global_table(‘sticky’);
    add_global_table(‘terms’);
    add_global_table(‘term_relationships’);
    add_global_table(‘term_taxonomy’);
    add_global_table(‘wppa_albums’);
    add_global_table(‘wppa_photos’);
    add_global_table(‘wscategories’);
    add_global_table(‘wsdays’);
    add_global_table(‘wsitems’);
    add_global_table(‘add_new_users_queue’);
    add_global_table(‘am_actions’);
    add_global_table(‘am_queue’);
    add_global_table(‘am_schedule’);
    add_global_table(‘batch_create_queue’);
    add_global_table(‘blog_versions’);
    add_global_table(‘blogs’);
    add_global_table(‘bp_activity_user_activity_cached’);
    add_global_table(‘bp_friends’);
    add_global_table(‘bp_groups’);
    add_global_table(‘bp_groups_groupmeta’);
    add_global_table(‘bp_groups_members’);
    add_global_table(‘bp_groups_wire’);
    add_global_table(‘bp_messages_messages’);
    add_global_table(‘bp_messages_notices’);
    add_global_table(‘bp_messages_recipients’);
    add_global_table(‘bp_messages_threads’);
    add_global_table(‘bp_notifications’);
    add_global_table(‘bp_user_blogs’);
    add_global_table(‘bp_user_blogs_blogmeta’);
    add_global_table(‘bp_user_blogs_comments’);
    add_global_table(‘bp_user_blogs_posts’);
    add_global_table(‘bp_xprofile_data’);
    add_global_table(‘bp_xprofile_fields’);
    add_global_table(‘bp_xprofile_groups’);
    add_global_table(‘bp_xprofile_wire’);
    add_global_table(‘cross_post_blogs’);
    add_global_table(‘crossposts’);
    add_global_table(‘gb_templates’);
    add_global_table(‘registration_log’);
    add_global_table(‘signups’);
    add_global_table(‘site’);
    add_global_table(‘site_posts’);
    add_global_table(‘sitecategories’);
    add_global_table(‘sitemeta’);
    add_global_table(‘term_counts’);
    add_global_table(‘tips’);
    add_global_table(‘usermeta’);
    add_global_table(‘users’);
    add_global_table(‘ust’);
    add_global_table(‘supporters’);
    add_global_table(‘supporter_signup_stats’);
    add_global_table(‘supporter_daily_stats’);
    add_global_table(‘supporter_ads’);

    Do we have to add something else, or remove any line???

    How to confirm this ???

  • Andrew

    Hiya,

    You don't need to add default tables. So remove these:
    add_global_table(‘commentmeta’);
    add_global_table(‘comments’);
    add_global_table(‘links’);
    add_global_table(‘options’);
    add_global_table(‘postmeta’);
    add_global_table(‘posts’);;
    add_global_table(‘terms’);
    add_global_table(‘term_relationships’);
    add_global_table(‘term_taxonomy’);
    add_global_table(‘blog_versions’);
    add_global_table(‘blogs’);
    add_global_table(‘bp_activity_user_activity_cached’);
    add_global_table(‘bp_friends’);
    add_global_table(‘bp_groups’);
    add_global_table(‘bp_groups_groupmeta’);
    add_global_table(‘bp_groups_members’);
    add_global_table(‘bp_groups_wire’);
    add_global_table(‘bp_messages_messages’);
    add_global_table(‘bp_messages_notices’);
    add_global_table(‘bp_messages_recipients’);
    add_global_table(‘bp_messages_threads’);
    add_global_table(‘bp_notifications’);
    add_global_table(‘bp_user_blogs’);
    add_global_table(‘bp_user_blogs_blogmeta’);
    add_global_table(‘bp_user_blogs_comments’);
    add_global_table(‘bp_user_blogs_posts’);
    add_global_table(‘bp_xprofile_data’);
    add_global_table(‘bp_xprofile_fields’);
    add_global_table(‘bp_xprofile_groups’);
    add_global_table(‘bp_xprofile_wire’);
    add_global_table(‘registration_log’);
    add_global_table(‘signups’);
    add_global_table(‘site’);
    add_global_table(‘sitecategories’);
    add_global_table(‘sitemeta’);
    add_global_table(‘usermeta’);
    add_global_table(‘users’);

    Thanks,
    Andrew

  • bdonaghy

    We are using some plugins (see list sample)

    How we can know, if we need create global tables for any?

    Or we need create global tables (in db-config.php) only for MU plugins(located in mu-plugins folder)???

    Add New Users
    AddToAny: Share/Bookmark/Email Button
    Admin Ads
    Admin Panel Tips
    Author Avatars List
    Auto Follow Up Emails
    Batch Create
    Blog Templates
    Content Monitor
    Exec-PHP
    Featured Content Gallery
    Lock Posts
    Next Gen Gallery
    Plugin Commander
    Rebranding MU
    Recent Posts (Global)
    Remove Browse Happy
    Send Invites
    Show Post Shortcode
    Site Wide Text Change
    SMS Text Message
    Unfiltered MU
    Wordpress Related Posts
    WP Authors
    WP to Twitter

    Thank you!

  • Andrew

    Hiya,

    It really depends on the plugins. First you need to check the plugin (look through the code) to see if it adds a db table. Most of the plugins you've listed do not. Next you need to check to see if the table is created per blog or only one table for the whole site. The latter would be a global table with the former being known as a blog table.

    All of our plugins will come with a sql.txt file that will let you know which tables to add to db-config.php. Other plugins from other places most likely will not come with such a file. You'll have to figure out if those plugins add any db tables.

    You'll need to check the others. We're happy to answer questions about our plugins but you'll need to handle the others on your own.

    Thanks,
    Andrew

  • bdonaghy

    Sorry

    See code here:

    function ahp_recent_posts($how_many, $how_long, $optmask = 67, $exc_size = 30, $begin_wrap = '<div class="ahp_recent-posts">', $end_wrap = '</div>') {
    global $wpdb;
    $counter = 0;

    // EDIT THESE TO CUSTOMIZE THE OUTPUT
    $debug = 0;
    $blog_prefix = "on ";
    $post_prefix = "";
    $auth_prefix = ' by ';
    $com_prefix = ' | ';
    $date_format = 'D M jS, Y';
    $grav_size = 85;

    // DISPLAY OPTIONS BITMASK
    $grav_flag = 1; // gravatar
    $post_flag = 2; // post name
    $name_flag = 4; // blog name
    $date_flag = 16; // date
    $auth_flag = 32; // author name
    $exc_flag = 64; // post excerpt
    $cap_flag = 128; // excerpt capitalization

    // set the various option flags
    if ($optmask & $grav_flag) { $use_grav = 1; } else { $use_grav = 1; }
    if ($optmask & $date_flag) { $use_date = 1; } else { $use_date = 0; }
    if ($optmask & $auth_flag) { $use_auth = 1; } else { $use_auth = 0; }
    if ($optmask & $com_flag) { $use_com = 1; } else { $use_com = 0; }
    if ($optmask & $name_flag) { $use_name = 1; } else { $use_name = 0; }
    if ($optmask & $post_flag) { $use_post = 1; } else { $use_post = 0; }
    if ($optmask & $exc_flag) { $use_exc = 1; } else { $use_exc = 0; }
    if ($optmask & $cap_flag) { $use_cap = 1; } else { $use_cap = 0; }

    // debug block
    if ($debug) {
    echo '<hr>'.'opt = '.$optmask.': grav = '.$use_grav.', date = '.$use_date
    .', auth = '.$use_auth.', use_com = '.$use_com.', use_name = '.$use_name
    .', use_post = '.$use_post.',use_exc = '.$use_exc.', use_cap = '.$use_cap;
    }

    // get a list of blogs in order of most recent update. show only public and nonarchived/spam/mature/deleted
    $blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE
    public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id != '1' AND
    last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)
    ORDER BY last_updated DESC");

    if ($blogs) {

    foreach ($blogs as $blog) {

    // we need _posts, _comments, and _options tables for this to work
    $blogOptionsTable = "wp_".$blog."_options";
    $blogPostsTable = "wp_".$blog."_posts";
    $blogCommentsTable = "wp_".$blog."_comments";

    // debug block
    if ($debug) {
    echo '<hr>processing blog '.$blog.' = <a href="'.
    $options[0]->option_value.'">'.$options[1]->option_value.'
    ';
    }

    // fetch the ID, post title, post content, post date, and user's email for the latest post
    $thispost = $wpdb->get_results("SELECT $blogPostsTable.ID, $blogPostsTable.post_title,
    $blogPostsTable.post_content, $blogPostsTable.post_date, wp_users.display_name,
    wp_users.user_email, wp_users.user_login
    FROM $blogPostsTable, wp_users
    WHERE wp_users.ID = $blogPostsTable.post_author
    AND post_status = 'publish' AND post_type = 'post'
    AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)
    AND $blogPostsTable.id > 1
    ORDER BY $blogPostsTable.id DESC limit 0,1");

    // if it is found put it to the output
    if($thispost) {

    // debug block
    if ($debugflag) {
    echo 'processing thispost ID = '.$thispost[0]->ID.'
    ';
    echo 'post_title = '.$thispost[0]->post_title.'
    ';
    //echo 'post_content = '.$thispost[0]->post_content.'
    ';
    echo 'post_date = '.$thispost[0]->post_date.'
    ';
    echo 'display_name = '.$thispost[0]->display_name.'
    ';
    echo 'user_email = '.$thispost[0]->user_email.'
    ';
    echo 'user_login = '.$thispost[0]->user_login.'
    ';
    }

    // get post ID
    $thispostID = $thispost[0]->ID;

    // get permalink by ID. check wp-includes/wpmu-functions.php
    $thispermalink = get_blog_permalink($blog, $thispostID);

    // get blog name, URL
    if ($use_name) {

    $options = $wpdb->get_results("SELECT option_value FROM
    $blogOptionsTable WHERE option_name IN ('siteurl','blogname')
    ORDER BY option_name DESC");

    $blog_link = $options[0]->option_value;
    $blog_name = $options[1]->option_value;
    $this_blogname = $blog_prefix.''.$blog_name.'';

    } else { $this_blogname = ''; }

    // get comments
    if ($use_com) {

    // sql query for all comments on the current post
    $thesecomments = $wpdb->get_results("SELECT comment_ID
    FROM $blogCommentsTable
    WHERE comment_post_ID = $thispostID");

    // count total number of comments
    $num_comments = sizeof($thesecomments);

    // pretty text
    if ($num_comments == 0) { $thiscomment = $com_prefix.'no comments'; }
    elseif ($num_comments == 1) { $thiscomment = $com_prefix.'one comment'; }
    else { $thiscomment = $com_prefix.$num_comments.' comments'; }

    } else { $thiscomment = ''; }

    // get author
    if ($use_auth) {
    $thisauthor = $auth_prefix.$thispost[0]->display_name;
    } else { $thisauthor = ''; }

    // get author's posts link
    $thisuser = $thispost[0]->user_login;
    $thisuser_url = $thisbloglink."author/".$thisuser;

    // get gravatar
    /* if ($use_grav) {
    $grav_img = get_avatar( $thispost[0]->user_email , $grav_size );
    $thisgravatar = ''.$grav_img.'';
    } else { $thisgravatar = ''; } */

    // get post date (nicely formatted)
    if ($use_date) {
    $thisdate = date($date_format, strtotime( $thispost[0]->post_date )) ;
    } else { $thisdate = ''; }

    // get post name
    if ($use_post) {
    $this_postname = $post_prefix.''.$thispost[0]->post_title.'
    ';
    } else { $this_postname = ''; }

    if ($use_exc) {

    if ($exc_size == 0) { $thisexcerpt = ''; }
    else {
    // get post content and truncate to (numwords) words
    $thiscontent = strip_tags( $thispost[0]->post_content );
    preg_match("/([\S]+\s*){0,$exc_size}/", $thiscontent, $regs);

    if ($use_cap) {
    // build the excerpt html block, capitalize first five words
    $trunc_content = explode( ' ', trim($regs[0]) , 6 );
    $exc_str = strtoupper($trunc_content[0]).' '
    .strtoupper($trunc_content[1]).' '
    .strtoupper($trunc_content[2]).' '
    .strtoupper($trunc_content[3]).' '
    .strtoupper($trunc_content[4]).' '
    .$trunc_content[5].'... ';
    } else { $exc_str = trim($regs[0]); }

    $thisexcerpt = '<span style="ahp-excerpt">'.$exc_str
    .''
    .'»»MORE'.'
    </span>';
    }
    } else { $thisexcerpt = ''; }

    echo $begin_wrap
    .$thisgravatar
    .'<small>'.$thisdate.$thisauthor.$thiscomment.'</small>
    '
    .$this_blogname
    .$this_postname
    .'<small>'.$thisexcerpt.'</small>'
    .$end_wrap;

    $counter++;
    }

    // don't go over the limit
    if($counter >= $how_many) {
    break;
    }
    }
    }
    else {
    //echo "no recent posts meet the criteria...
    ";
    }
    }
    ?>

  • Andrew

    Hiya,

    We find in plugins code lines with 'global $wpdb' this is for connection to global DB???

    Erm, no. The word "global" in "global $wpdb" is just being used to pull the global variable/class "$wpdb" into the function. It has nothing to do with global tables.

    How we can find name for global table: add_global_table(‘name’); in code???

    There aren't any tables being created in the code you provided.

    Again, we're happy to assist with our plugins but we really cannot assist with plugins from other developers. If you're running a site large enough to requite Multi-DB then you should really have someone that can assist with this.

    Thanks,
    Andrew

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.