MultiDB Move-Blogs Error

I'm doing an install of MultiDB on a brand new wordpress 3.0 installation with the main blog being the only blog.

When i visited the move-blogs.php page it showed all the new db's as existing so i ran the copy process and got the following error

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/myaccount/public_html/wp-content/scripts/move-blogs.php on line 140

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/myaccount/public_html/wp-content/scripts/move-blogs.php on line 141

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/myaccount/public_html/wp-content/scripts/move-blogs.php on line 140

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/myaccount/public_html/wp-content/scripts/move-blogs.php on line 141

(and this repeats for about 30 lines

Then i refreshed the page and it shows in the status fields that the table is in new db.

However when i visit the website url it brings up errors such as this

error in IE - Warning: Invalid argument supplied for foreach() in /home/myaccount/public_html/wp-content/db.php on line 164

Fatal error: Call to undefined method m_wpdb::handle_error_connecting() in /home/myaccount/public_html/wp-content/db.php on line 223

I uploaded

  • sjrenn

    Here are all of my multi-db edited files.
    (All files have been edited to remove my actual server information)


    WP Config


    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'fake123_wrdp1');

    /** MySQL database username */
    define('DB_USER', 'fake123_wrdp1');

    /** MySQL database password */
    define('DB_PASSWORD', 'fdklsidjf');

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    DB Config

    // Version: 2.9.2
    //------------------------------------------------------------------------//
    //---DB Scaling-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    // 16,256,4096
    define ('DB_SCALING', '16');
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_dc_ip(IP, DC)
    // EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('838.83.838.', 'dc1');
    //------------------------------------------------------------------------//
    //---Global Tables--------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Do not include default global tables
    // Leave off base prefix (eg: wp_)
    //
    // Usage: add_global_table(TABLE_NAME)
    // EX: add_global_table('something');
    add_global_table('fake123_global');
    //------------------------------------------------------------------------//
    //---DB Servers-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Database servers grouped by dataset.
    // R can be 0 (no reads) or a positive integer indicating the order
    // in which to attempt communication (all locals, then all remotes)
    //
    // Usage: add_db_server(DS, DC, READ, WRITE, HOST, LAN_HOST, NAME, USER, PASS)
    // EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');
    //
    // Note: you can also place this section in a file called db-list.php in wp-content
    // EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser', 'globalpassword');
    add_db_server('global', 'dc1', 1, 1,'','208.86.152.136', 'fake123_0', 'fake123_wrdp1', 'fdklsidjf');

    add_db_server('0', 'dc1', 1, 1,'','838.83.838.838', 'fake123_0', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('1', 'dc1', 1, 1,'','838.83.838.838', 'fake123_1', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('2', 'dc1', 1, 1,'','838.83.838.838', 'fake123_2', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('3', 'dc1', 1, 1,'','838.83.838.838', 'fake123_3', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('4', 'dc1', 1, 1,'','838.83.838.838', 'fake123_4', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('5', 'dc1', 1, 1,'','838.83.838.838', 'fake123_5', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('6', 'dc1', 1, 1,'','838.83.838.838', 'fake123_6', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('7', 'dc1', 1, 1,'','838.83.838.838', 'fake123_7', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('8', 'dc1', 1, 1,'','838.83.838.838', 'fake123_8', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('9', 'dc1', 1, 1,'','838.83.838.838', 'fake123_9', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('a', 'dc1', 1, 1,'','838.83.838.838', 'fake123_a', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('b', 'dc1', 1, 1,'','838.83.838.838', 'fake123_b', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('c', 'dc1', 1, 1,'','838.83.838.838', 'fake123_c', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('d', 'dc1', 1, 1,'','838.83.838.838', 'fake123_d', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('e', 'dc1', 1, 1,'','838.83.838.838', 'fake123_e', 'fake123_wrdp1', 'fdklsidjf');
    add_db_server('f', 'dc1', 1, 1,'','838.83.838.838', 'fake123_f', 'fake123_wrdp1', 'fdklsidjf');

    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_vip_blog(BLOG_ID, DS)
    // EX: add_vip_blog(1, 'vip1');

    ?>

    move-blogs.php


    //------------------------------------------------------------------------//
    //---Config---------------------------------------------------------------//
    //------------------------------------------------------------------------//

    ///DB Settings
    $dbname = "fake123_wrdp1"; //This is your current database
    $blog_table_prefix = 'wp_'; //Prefix of your wpmu blog tables, most likely this won't need to be changed
    $newdb_prefix = 'fake123_'; //This is the prefix of the db's you're moving your tables into - we assume they are all the same, if not, you're in trouble

    //We need info to connect to the databases
    $dbhost = 'localhost';
    $dbuname = 'fake123_wrdp1';
    $dbpass = 'fdklsidjf';

    //How many db's are you moving into (16, 256, or 4096)?
    $db_scaling = '16';

    //------------------------------------------------------------------------//
    ?>

  • Barry

    Ok, couple of issues in your files -
    db-config.php
    add_global_table('fake123_global')
    Do you have a table called wp_fake123_global in your database? If not, this line shouldn't be here.

    add_db_server('global', 'dc1', 1, 1,'','208.86.152.136', 'fake123_0', 'fake123_wrdp1', 'fdklsidjf');
    Seems to point to the same database as:
    add_db_server('0', 'dc1', 1, 1,'','838.83.838.838', 'fake123_0', 'fake123_wrdp1', 'fdklsidjf');
    Can you set up a global database to use that is separate from the other databases and see if that helps?

    Update: Sorry, it seems to be at a different IP address but with the same name - is that correct?

    Finally, can you populate all the '' entries with the IP address.

  • sjrenn

    There is no wp_fake123_global. So that line should just be erased?

    In the setup guide it claims "Line 25: Provide the same name you assigned for your global database in Step 2. example 'dbname_global'"

    So this can just be ignored?

    Also i'm not quite sure what you mean by seperate from the other databases? Do you mean a create a new user and grant them privileges instead of the main user?

    Also the IP addresses are the same, i just didn't edit one of them before posting.

  • Barry

    I'm not supposed to add all of the wp_ tables from the main database that was created during the wordpress installtion to the config file am I?

    If it is a standard wp table then, no.

    Also i'm not quite sure what you mean by seperate from the other databases?

    For a 16 db installation you need 17 databases, 16 named 0 - f and one global. You only have 16 db's in your config, the global declaration appears to be using the same database as your 0 one.

  • tjopper

    Hi there,

    First of all thanks for your great plugins and support you are giving here.
    I actually have the smae problem as mentioned above. I Have the global clarified, but I got the following errors in the moveblogs.php:

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 140

    Warning: mysql_free_result() expects parameter 1 to be resource, string given in /home/smisp/domains/smisp.eu/public_html/wp-content/scripts/move-blogs.php on line 141

    [EDIT: CODE removed by moderator. NEVER post your database information on a public forum]

    When I look into the dtabase I can see that the global DB did fill-up but the other ones are still empty.

    Can you please help me out, cause I can;t find the error. I suspect a typo or some SQL rights should be the problem.

    Thanks in advance,
    Jop Hartog

  • Mason

    Hiya Jop,

    Many thanks for joining up at WPMU DEV!

    A couple things I wanted to share.

    1. This post is over a year old. That means it's not gonna get the same attention as asking a new question. We'd really appreciate it if you could open a new question each time so we can ensure it is addressed properly :slight_smile:

    2. I removed the sections of code with all the db usernames and passwords. That information could be used by someone to login to your site and cause mayhem. We def don't want that!

    As to your issue, there's several things we'll need to understand about your install to be able to troubleshoot. So when opening up a new question ( you can link back to this one for reference if you like) let's include what version of WordPress (multisite?) and what version of this plugin you are using.

    Helpful bits would be to copy the error one time here for us to read. Additionally we will probably want to see portions of db-config.php but not username/password info.

    Please provide the above and we'll help ya get this sorted as quickly as possible.

    thanks again for being a member :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.