Request step by step walk through on blank 3.0.1 multi site with 16 databases

Hello,

I've mucked about with WP 3 over the past 2 weeks and have sourced all fixes and upgrades from 2.9.2 to allow me to create a new WP 3.0.1 production environment.

I'd like to start from scratch with a whistle clean installation and without any unnecessary plug-ins I played around with earlier etc. etc.

I have cpanel VPS hosting.

1) I have installed WP 3.0.1 on a temporary db (mydb_temp) with user: (mydb_admin)

2) I've activated the network environment. ( wp-config, .htaccess, blogs.dir, mu-plugins )

3) I've created a test sub domain blog which works fine

4) I created 16 databases (mydb_0- -> mydb_f ) as below and added the admin to each manually using cpanel.

CREATE DATABASE mydb_0 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
etc
etc
CREATE DATABASE mydb_f DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

5) I've downloaded the plugin.

I've not added any plugins, themes or anything beyond what I listed above.

I'd be grateful if you would take me through the remaining steps, step by step.

I believe the next step is to configure the "db-config.php".

I can use the sample file as the basis.

What does the sample file need to look like if my IP is 123.456.78.9 and my databases settings are:

db: mydb_1 through mydb_f
user: mydb_admin
pass: abc123
location : localhost

Could you post the sample here?

I'm confused by:

<br />
//---DC IPs---------------------------------------------------------------//<br />
//------------------------------------------------------------------------//<br />
//	Usage: add_dc_ip(IP, DC)<br />
//	EX: add_dc_ip('123.123.123.', 'dc1');<br />
add_dc_ip('123.123.123.', 'dc1');<br />
//------------------------------------------------------------------------//<br />
//---Global Tables--------------------------------------------------------//<br />
//------------------------------------------------------------------------//<br />
//	Do not include default global tables<br />
//	Leave off base prefix (eg: wp_)<br />
//<br />
//	Usage: add_global_table(TABLE_NAME)<br />
//	EX: add_global_table('something');<br />
add_global_table('some_global_table');<br />

and

<br />
//	Note: you can also place this section in a file called db-list.php in wp-content<br />
add_db_server('global', 'dc1', 1, 1,'64.120.23.72','192.168.0.101', 'wpmu_global', 'db_user_name',  'db_user_name_pass');</p>
<p>add_db_server('vip1', 'dc1', 1, 1,'64.120.23.72','192.168.0.101', 'wpmu_vip_1', 'db_user_name',  'db_user_name_pass');<br />
//------------------------------------------------------------------------//<br />
//---VIP Blogs------------------------------------------------------------//<br />
//------------------------------------------------------------------------//<br />
//	Usage: add_vip_blog(BLOG_ID, DS)<br />
//	EX: add_vip_blog(1, 'vip1');</p>
<p>add_vip_blog(1, 'vip1');<br />

What comes next?

What do I do with my existing db which is: mydb_temp ?

Do I keep that?

Many thanks in advance,
Ralf

  • 2Ps

    Hi James and Aaron,

    I need to have this site up and running this weekend.

    Any chance you could give me the config file and move BD scripts personalized to me given the info I've posted above?

    If my IP address is 123.456.78.9 is this bit below correct?

    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_dc_ip(IP, DC)
    // EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('123.456.78.', 'dc1');
    //------------------------------------------------------------------------//

    Does the next bit look right to you? I used MyPHPAdmin to get the tables from my db and copied and pasted into the script like so:

    What are the default global tables not to include here? How do I know which table are default tables and which are not?

    //---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('2_commentmeta');
    add_global_table('2_comments');
    add_global_table('2_links');
    add_global_table('2_options');
    add_global_table('2_postmeta');
    add_global_table('2_posts');
    add_global_table('2_terms');
    add_global_table('2_term_relationships');
    add_global_table('2_term_taxonomy');
    add_global_table('blogs');
    add_global_table('blog_versions');
    add_global_table('wp_commentmeta');
    add_global_table('wp_comments');
    add_global_table('links');
    add_global_table('options');
    add_global_table('postmeta');
    add_global_table('posts');
    add_global_table('signups');
    add_global_table('site');
    add_global_table('sitemeta');
    add_global_table('terms');
    add_global_table('term_relationships');
    add_global_table('term_taxonomy');
    add_global_table('usermeta');
    add_global_table('users');

    Then there the section about re the servers.
    Is this correct given:

    db name: mydb_0 - mydb_f
    user: mydb_admin
    pass: abc123

    What about the lines in bold below? I don't get those:

    //------------------------------------------------------------------------//
    //---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,'64.120.23.72','192.168.0.101', 'wpmu_global', 'db_user_name', 'db_user_name_pass');

    add_db_server('0', 'dc1', 1, 1,'','localhost', 'mydb_0', 'mydb_admin', 'abc123');
    add_db_server('1', 'dc1', 1, 1,'','localhost', 'mydb_1', 'mydb_admin', 'abc123');
    add_db_server('2', 'dc1', 1, 1,'','localhost', 'mydb_2', 'mydb_admin', 'abc123');
    add_db_server('3', 'dc1', 1, 1,'','localhost', 'mydb_3', 'mydb_admin', 'abc123');
    add_db_server('4', 'dc1', 1, 1,'','localhost', 'mydb_4', 'mydb_admin', 'abc123');
    add_db_server('5', 'dc1', 1, 1,'','localhost', 'mydb_5', 'mydb_admin', 'abc123');
    add_db_server('6', 'dc1', 1, 1,'','localhost', 'mydb_6', 'mydb_admin', 'abc123');
    add_db_server('7', 'dc1', 1, 1,'','localhost', 'mydb_7', 'mydb_admin', 'abc123');
    add_db_server('8', 'dc1', 1, 1,'','localhost', 'mydb_8', 'mydb_admin', 'abc123');
    add_db_server('9', 'dc1', 1, 1,'','localhost', 'mydb_9', 'mydb_admin', 'abc123');
    add_db_server('a', 'dc1', 1, 1,'','localhost', 'mydb_a', 'mydb_admin', 'abc123');
    add_db_server('b', 'dc1', 1, 1,'','localhost', 'mydb_b', 'mydb_admin', 'abc123');
    add_db_server('c', 'dc1', 1, 1,'','localhost', 'mydb_c', 'mydb_admin', 'abc123');
    add_db_server('d', 'dc1', 1, 1,'','localhost', 'mydb_d', 'mydb_admin', 'abc123');
    add_db_server('e', 'dc1', 1, 1,'','localhost', 'mydb_e', 'mydb_admin', 'abc123');
    add_db_server('f', 'dc1', 1, 1,'','localhost', 'mydb_f', 'mydb_admin', 'abc123');

    add_db_server('vip1', 'dc1', 1, 1,'localhost', 'mydb_vip_1', 'mydb_admin', 'abc123'');

    (for the last line above I'll create a new db called mydb_vip1 right?

    And below I assign which blogs to reside on mydb_vip_1

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

    add_vip_blog(1, 'vip1');
    add_vip_blog(2, 'vip1');
    add_vip_blog(3, 'vip1');

    Is it one blog per line?

    Can I add to this in future?

    What are the implications if I start setting up the site now with plugins etc before I've got the Multi-db using? More global tables?

    I intend to keep all the db's on localhost for now, but since this is a commercial project I assume that I need to put the db on a separate machine in future and maybe break that up over a couple of servers in 2-3 years.

    many thanks for your guidance,

    Ralf

  • 2Ps

    Aaron. I believe in my case the header of the move blogs script would look like this:


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

    ///DB Settings
    $dbname = "mydb_temp"; //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 = 'mydb_'; //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 = 'mydb_admin';
    $dbpass = 'abc123';

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

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

    Does the move blogs script refer to the config file for names of all of the 16 databases?

    What about the bit in the config file re the VIP and global databases?

    Thanks

    Ralf

  • 2Ps

    Hi Guys, sorry I'm charging forward, I'm really pressed for time.

    Given the following info, does the db-config below look right to you?

    db names:
    mydb_global, (currently using and set in wp-config.php)
    mydb_0 -> mydb_f, (that's 16 db)
    mydb_vip1 (newly created)
    user: mydb_admin
    pass:
    abc123
    IP: 123.456.78.9

    ===================================================================

    // Plugin Name: Multi-DB
    // Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    // Author: Andrew Billits (Incsub)
    // 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('123.456.78.', '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('2_commentmeta');
    add_global_table('2_comments');
    add_global_table('2_links');
    add_global_table('2_options');
    add_global_table('2_postmeta');
    add_global_table('2_posts');
    add_global_table('2_terms');
    add_global_table('2_term_relationships');
    add_global_table('2_term_taxonomy');
    add_global_table('blogs');
    add_global_table('blog_versions');
    add_global_table('wp_commentmeta');
    add_global_table('wp_comments');
    add_global_table('links');
    add_global_table('options');
    add_global_table('postmeta');
    add_global_table('posts');
    add_global_table('signups');
    add_global_table('site');
    add_global_table('sitemeta');
    add_global_table('terms');
    add_global_table('term_relationships');
    add_global_table('term_taxonomy');
    add_global_table('usermeta');
    add_global_table('users');

    //------------------------------------------------------------------------//
    //---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,'localhost', 'mydb_global, 'mydb_admin', 'abc123');

    add_db_server('0', 'dc1', 1, 1,'','localhost', 'mydb_0', 'mydb_admin', 'abc123');
    add_db_server('1', 'dc1', 1, 1,'','localhost', 'mydb_1', 'mydb_admin', 'abc123');
    add_db_server('2', 'dc1', 1, 1,'','localhost', 'mydb_2', 'mydb_admin', 'abc123');
    add_db_server('3', 'dc1', 1, 1,'','localhost', 'mydb_3', 'mydb_admin', 'abc123');
    add_db_server('4', 'dc1', 1, 1,'','localhost', 'mydb_4', 'mydb_admin', 'abc123');
    add_db_server('5', 'dc1', 1, 1,'','localhost', 'mydb_5', 'mydb_admin', 'abc123');
    add_db_server('6', 'dc1', 1, 1,'','localhost', 'mydb_6', 'mydb_admin', 'abc123');
    add_db_server('7', 'dc1', 1, 1,'','localhost', 'mydb_7', 'mydb_admin', 'abc123');
    add_db_server('8', 'dc1', 1, 1,'','localhost', 'mydb_8', 'mydb_admin', 'abc123');
    add_db_server('9', 'dc1', 1, 1,'','localhost', 'mydb_9', 'mydb_admin', 'abc123');
    add_db_server('a', 'dc1', 1, 1,'','localhost', 'mydb_a', 'mydb_admin', 'abc123');
    add_db_server('b', 'dc1', 1, 1,'','localhost', 'mydb_b', 'mydb_admin', 'abc123');
    add_db_server('c', 'dc1', 1, 1,'','localhost', 'mydb_c', 'mydb_admin', 'abc123');
    add_db_server('d', 'dc1', 1, 1,'','localhost', 'mydb_d', 'mydb_admin', 'abc123');
    add_db_server('e', 'dc1', 1, 1,'','localhost', 'mydb_e', 'mydb_admin', 'abc123');
    add_db_server('f', 'dc1', 1, 1,'','localhost', 'mydb_f', 'mydb_admin', 'abc123');

    add_db_server('vip1', 'dc1', 1, 1,'localhost', 'mydb_f', 'mydb_admin', 'abc123');
    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    // Usage: add_vip_blog(BLOG_ID, DS)
    // EX: add_vip_blog(1, 'vip1');

    add_vip_blog(1, 'vip1');
    ?>

    ========================================================================

    What I don't get is that it looks like there are really 18 databases mydb_1 ->mydb_f plus the mydb_vip1 and mydb_global.

    Is this correct?

    If yes, then I assume I'll upload:

    db.php - goes in /wp-content
    db-config.php - goes in /wp-content
    move-blogs.php - goes in /wp-content/scripts

    and then navigate to mydomain.tld/wp-content/scripts/move-blogs.php

    Is that it?

    Thanks

    Ralf

  • 2Ps

    Hi Aaron, many thanks.

    I did not get what you mean with " You only need to add lines for site wide plugins you install in the future (before installing)."

    Do you mean, I need to add a line per new table for each plugin, before activating the plugin?

    Can I do this in future after having switched to Multi DB?

    I now have ca. 70 tables. Am I correct in assuming I add all those tables minus the global tables listed above?

    Can you please explain the bit below about the global database. Is that the current db before switching to Multi DB?

    // 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,'localhost', 'mydb_global, 'mydb_admin', 'abc123');

    Thanks v-much,
    Ralf

  • Aaron

    You don't need to register any global tables right now.

    Later on when you install certain sitewide plugins that create db tables that are not blog specific, you may need to register those tables before installing. For ours we try to put that in the install instructions.

    To your question, you do need to create the global db "mydb_global" and have that line:
    add_db_server('global', 'dc1', 1, 1,'localhost', 'mydb_global, 'mydb_admin', 'abc123');