Multi DB functionality questions

I spent some time yesterday and got multi-db setup. I "believe" it's working, but I don't think I quite understand how it is intended to operate.

I setup a test bed VM on my Proxmox OpenVZ server using the wordpress default container running debian 5.0.2. Here is roughly the steps I took...

Configured Wordpress, initially it is v2.9
Changed login info to my liking
Upgraded WP to 3.1
Enabled MU
Configured multi site to use subdirectories
configured basic permalinks
Installed Buddy Press, default configuration
User registration and blog creation enabled
Installed Blogs-MU theme.
Installed Multi DB as per the instructions as 256 databases available.

Initially I had a couple problems with my syntax, but ended up getting it all worked out once I found my syntax errors.

MySQL was initially configured with the DB "wordpress"
MySQL user was "wordpress"

If I understand correctly, after it's all said and done is the main database for the main site supposed to be the "*_global" mysql database?

At what point do new blog's begin to utilize the additional databases created during the install of multi-db, and what determines that?

Once, setup. The instructions seem to indicate that that is all and no more needs to be done or managed from that point on. But I don't quite understand how it is all supposed to flow?

  • Barry

    At what point do new blog's begin to utilize the additional databases created during the install of multi-db, and what determines that?

    As soon as a new blog/site is created it's tables will be created in one of the 256 databases and will use that database from that point onwards. The database it uses is based on the md5 of the blog/sites id depending on the number of databases you are using.

    So if the blog id is 2 and the md5 of 2 is c81e728d9d4c2f636f067f89cc14862c

    for 16 dbs the tables will be in databaseprefix_c
    for 256 dbs the tables will be in databaseprefix_c8
    for 4096 dbs the tables will be in databaseprefix_c81

  • Shawn

    @androidium, "Correct me if I am wrong, but is this simply intended to pick and choose "tables" specifically and put them into unique databases with the move-blogs.php script?"

    Yes, move-blogs.php is only intended to move existing blogs from the source/original database to your new multi-db databases, by splitting them into the appropriate distributed db. This should go VERY VERY quickly on a new install, where you've only got the one blog. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.