Where does Multi-db install fit into the steps for a new WPMU install?

Hi,
I'm creating a new WPMU installation. I want the Multi-db plugin installed from the very beginning. My databases are created. Everythng is ready to start the WPMU install (pointing to vip1?). What sequence should I follow, any special adjustments? move-db would not be needed?
Thanks!

    ChuckS

    Hi,

    I'm not necessarily a newbie but definitely an amature at this and desperately want to learn. I'm trying to set up a new WPMU with the multi-db plug-in. I've successfully set up the WPMU (per Andrea Rennick's awesome instructions). I've now been trying, unsuccessfully, to install the plug-in. Since I only have the main blog to move, instead of using the move-blog.php, I used MySQLAdmin and EXPORTED the Blog ID 1 tables and the global tables from the new WPMU database to my desktop in separate files, then IMPORTED them into the "vip1" database and "global" database respectively. I then deleted the tables in the "admin_WPMU" database. Below is a partial print of my db-config.php file. Don't laugh too hard when you read it, but please help me know where I'm going wrong.

    Other information: I have a new VPS at KnownHost. The account name for WPMU is "admin" and according to Andrea, the user name would be "admin_user". The new WPMU is installed in the "public_html" file of "admin" in the database "admin_wpmu". The new multi-db databases are called "admin_??". The user password is "password". (The names have been changed to protect the innocent.) I have several blogs that are expected to have lots of traffic, so I would like to give them their own "vip" database. I've been using wordpad to edit the code.

    My db-config.php file:

    <?php
    // Plugin Name: Multi-DB
    // Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    // Author: Andrew Billits (Incsub)
    // Version: 2.7.0
    //------------------------------------------------------------------------//
    //---DB Scaling-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    // 16,256,4096
    define ('DB_SCALING', '256');
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_dc_ip(IP, DC)
    // EX: add_dc_ip('67.222.24.144.', 'dc1');
    add_dc_ip('67.222.24.144.', '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('admin_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
    add_db_server('global', 'dc1', 1, 1,'67.222.24.144.', 'admin_global', 'admin_user', 'password');
    add_db_server('00', 'dc1', 1, 1,'67.222.24.144.', 'admin_00', 'admin_user', 'password');
    add_db_server('01', 'dc1', 1, 1,'67.222.24.144.', 'admin_01', 'admin_user', 'password');
    add_db_server('02', 'dc1', 1, 1,'67.222.24.144.', 'admin_02', 'admin_user', 'password');
    add_db_server('03', 'dc1', 1, 1,'67.222.24.144.', 'admin_03', 'admin_user', 'password');
    add_db_server('04', 'dc1', 1, 1,'67.222.24.144.', 'admin_04', 'admin_user', 'password');
    add_db_server('05', 'dc1', 1, 1,'67.222.24.144.', 'admin_05', 'admin_user', 'password');
    add_db_server('06', 'dc1', 1, 1,'67.222.24.144.', 'admin_06', 'admin_user', 'password');
    add_db_server('07', 'dc1', 1, 1,'67.222.24.144.', 'admin_07', 'admin_user', 'password');
    add_db_server('08', 'dc1', 1, 1,'67.222.24.144.', 'admin_08', 'admin_user', 'password');
    add_db_server('09', 'dc1', 1, 1,'67.222.24.144.', 'admin_09', 'admin_user', 'password');
    add_db_server('0a', 'dc1', 1, 1,'67.222.24.144.', 'admin_0a', 'admin_user', 'password');
    add_db_server('0b', 'dc1', 1, 1,'67.222.24.144.', 'admin_0b', 'admin_user', 'password');
    add_db_server('0c', 'dc1', 1, 1,'67.222.24.144.', 'admin_0c', 'admin_user', 'password');
    add_db_server('0d', 'dc1', 1, 1,'67.222.24.144.', 'admin_0d', 'admin_user', 'password');
    add_db_server('0e', 'dc1', 1, 1,'67.222.24.144.', 'admin_0e', 'admin_user', 'password');
    add_db_server('0f', 'dc1', 1, 1,'67.222.24.144.', 'admin_0f', 'admin_user', 'password');
    add_db_server('10', 'dc1', 1, 1,'67.222.24.144.', 'admin_10', 'admin_user', 'password');
    add_db_server('11', 'dc1', 1, 1,'67.222.24.144.', 'admin_11', 'admin_user', 'password');
    add_db_server('12', 'dc1', 1, 1,'67.222.24.144.', 'admin_12', 'admin_user', 'password');
    add_db_server('13', 'dc1', 1, 1,'67.222.24.144.', 'admin_13', 'admin_user', 'password');
    add_db_server('14', 'dc1', 1, 1,'67.222.24.144.', 'admin_14', 'admin_user', 'password');
    add_db_server('15', 'dc1', 1, 1,'67.222.24.144.', 'admin_15', 'admin_user', 'password');
    add_db_server('16', 'dc1', 1, 1,'67.222.24.144.', 'admin_16', 'admin_user', 'password');
    add_db_server('17', 'dc1', 1, 1,'67.222.24.144.', 'admin_17', 'admin_user', 'password');
    add_db_server('18', 'dc1', 1, 1,'67.222.24.144.', 'admin_18', 'admin_user', 'password');
    add_db_server('19', 'dc1', 1, 1,'67.222.24.144.', 'admin_19', 'admin_user', 'password');
    add_db_server('1a', 'dc1', 1, 1,'67.222.24.144.', 'admin_1a', 'admin_user', 'password');
    add_db_server('1b', 'dc1', 1, 1,'67.222.24.144.', 'admin_1b', 'admin_user', 'password');

    etc., etc. for 256 databases from the create SQL Tool you wonderfully provided.

    add_db_server('fb', 'dc1', 1, 1,'67.222.24.144.', 'admin_fb', 'admin_user', 'password');
    add_db_server('fc', 'dc1', 1, 1,'67.222.24.144.', 'admin_fc', 'admin_user', 'password');
    add_db_server('fd', 'dc1', 1, 1,'67.222.24.144.', 'admin_fd', 'admin_user', 'password');
    add_db_server('fe', 'dc1', 1, 1,'67.222.24.144.', 'admin_fe', 'admin_user', 'password');
    add_db_server('ff', 'dc1', 1, 1,'67.222.24.144.', 'admin_ff', 'admin_user', 'password');
    add_db_server('vip1', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip1', 'admin_user', 'password');
    add_db_server('vip2', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip2', 'admin_user', 'password');
    add_db_server('vip3', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip3', 'admin_user', 'password');
    add_db_server('vip4', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip4', 'admin_user', 'password');
    add_db_server('vip5', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip5', 'admin_user', 'password');
    add_db_server('vip6', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip6', 'admin_user', 'password');
    add_db_server('vip7', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip7', 'admin_user', 'password');
    add_db_server('vip8', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip8', 'admin_user', 'password');
    add_db_server('vip9', 'dc1', 1, 1,'67.222.24.144.', 'admin_vip9', 'admin_user', 'password');
    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_vip_blog(BLOG_ID, DS)
    // EX: add_vip_blog(1, 'vip1');
    add_vip_blog(1, 'vip1');
    add_vip_blog(2, 'vip2');
    add_vip_blog(3, 'vip3');
    add_vip_blog(4, 'vip4');
    add_vip_blog(5, 'vip5');
    add_vip_blog(6, 'vip6');
    add_vip_blog(7, 'vip7');
    add_vip_blog(8, 'vip8');
    add_vip_blog(9, 'vip9');
    ?>

    Andrew

    Hiya,

    No worries. We'll get you up and running. First off, until you have it working, move the main blog (blog ID 1) tables to admin_c4. There's no need in having an extra level of complication while trying to get everything to work. You also need to comment out these lines:
    add_vip_blog(1, 'vip1');
    add_vip_blog(2, 'vip2');
    add_vip_blog(3, 'vip3');
    add_vip_blog(4, 'vip4');
    add_vip_blog(5, 'vip5');
    add_vip_blog(6, 'vip6');
    add_vip_blog(7, 'vip7');
    add_vip_blog(8, 'vip8');
    add_vip_blog(9, 'vip9');

    Now after you've done that, change this:
    add_dc_ip('67.222.24.144.', 'dc1');

    to this:
    add_dc_ip('67.222.24.', 'dc1');

    Also, change these:

    to this:
    add_db_server('00', 'dc1', 1, 1, 'localhost', 'localhost', 'admin_00', 'admin_user', 'password');

    That goes for all 256 blog databases, your global db and your VIP databases.

    Make those changes and if it still isn't working for you post your modified db-config.php.

    Thanks,
    Andrew

    dfontenot

    Hey Andrew,

    I've got to the same point as Chucks with this install. I have it working fine with the Blog 1 tables in c4, but when I import and export those files into vip1, delete the former ones, and uncomment the statement "add_vip_blog(1, ‘vip1?);" I get this message:

    "The blog you have requested is not installed properly. Please contact the system administrator."

    Any thoughts on that? It just seems like it is not connecting to the Vip1 database I've got there since it works fine with the c4 database.

    Thanks!

    David

    dfontenot

    Sweet!! It looks like 1) did the trick Andrew.

    You guys are awesome.

    One other question. In terms of the load put on a database, is it the same if I have 100,000 users with their own blogs vs. 100,000 users just adding posts and images?

    I'm considering creating gallery sites with all types of artwork. The users would not have an entire blog, but could put up as many posts as they would like with their artwork.

    I'd assume both put a heavy load on and probably should use the multi-db plugin with 256 databases.

    Thanks again for the help!

    David

    Andrew

    In terms of the load put on a database, is it the same if I have 100,000 users with their own blogs vs. 100,000 users just adding posts and images?

    Depends. If you have 100K users posting on one blog (just for an example) then the db that blog is in would have a decent load. If you have 100K users posting on several blogs then the load is spread over the databases those blogs are located in.

    Although really the load is all on the same server/MySQL instance unless you have the databases spread over multiple servers.

    Thanks,
    Andrew

    drmike

    One of my clients last night pointed out another use of a vip database setup: If the client wants to be in control of the database and have it on one of their servers. While I can see a setup like that, I personally think that would be more trouble than good. Especially considering that the wpmu is still going to have data like users and whatnot. Lean more towards a single wp setup just for them in that case.

    If you have 100K users posting on several blogs then the load is spread of the databases those blogs are located in.

    Beginning to sound like a vBulletin forum around here.

    A possible rule of thumb is to use the wp.com vip guideline of 500k page views for a given month. If you're doing that on a single blog along with comments and posting, moving that blog's dbs into their own database (and probably server as well) may be something to consider.

    Of course you also have to take into account the use of a cache like wp-super-cache and other tricks. I'd be leaning towards those first before moving a db into their own vip setup.