Multi-Db install problems

I've managed to get quite a ways on the install process before I came to a problem I couldn't solve. I'm down to the move-blogs.php step from the directions in sticky above.

I've done a fresh install of wpmu 2.9.1 with buddypress 1.1.3 and bbpress 1.02 every thing was working great so then I started on installing multi-db 2.9 I'm on a shared server using webhost manager and cpanel. I wasn't sure I'd be able to install multi-db but gave it a try. I was able to install 4096 databases. I had to break up the sql file in smaller sections so it would fit into the size limits. I double checked after installing all databases are there and they are. I also checked cpanel main page and it shows 4097 databases I was feeling good about what I achieved. I'm running this on a test domain.

I then tried to run move-blogs.php and keep getting a 500 server error. I'm sure it has to do with config of either move-blogs.php or db-config.php I'm not sure which and need some help.

Here is db-config file down to the first of 4096 databases. I'm sure you don't want 4095 more lines
This worked to build databases along with the sql file

// Version: 2.9.0
//------------------------------------------------------------------------//
//---DB Scaling-----------------------------------------------------------//
//------------------------------------------------------------------------//
// 16,256,4096
define ('DB_SCALING', '4096');
//------------------------------------------------------------------------//
//---DC IPs---------------------------------------------------------------//
//------------------------------------------------------------------------//
// Usage: add_dc_ip(IP, DC)
// EX: add_dc_ip('123.123.123.', 'dc1');
add_dc_ip('174.121.10.', '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('_wpmu');
//------------------------------------------------------------------------//
//---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('000', 'dc1', 1, 1,'localhost','localhost', 'dapnet_wpmu_000', 'wpmu', 'xxxxxxxx');
-------------------------------------------------------------------------------------------------------------------------------------------

below is the area that needs configured on the move-blogs.php

///DB Settings
$dbname = "dapnet_wpmu"; //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 = 'dapnet_wpmu_'; //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 = 'dapnet_wpmu';
$dbpass = 'xxxxxxx';

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

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

I tried a dozen different configuration and none worked. I'm hoping the next one, with some help, will.
Please look over the above configuration and let me know what is wrong, Thank You!

  • dapadoo

    OK, I'm not sure how it happened but I'm now I no longer show the 500 error.

    I'm seeing the following but nothing below it. When I click on start copy process nothing happened. I hope this helps to figure out the configuration needed

    1.Tested on PHP 5 & MySQL 5
    2.Make sure all of your new db's exist (green text next to table name in db column below)
    3.In the status section, each table should show not in new db (unless you've already run this script)
    4.To start the copy process click here
    5.Be patient, depending on how many blogs you have, this could take a while
    6.Once completed, refresh this page by clicking here
    7.Check to make sure that in the status section all tables say table in new db
    8.Rejoice, I probably just saved you hours of your life!
    9.If this didn't work, don't blame me. Sometimes life is just like that..

    table name table info new db status

  • Andrew

    Hiya,

    A couple of questions:

    1) Do you have a table called wp_wpmu? I'm asking because of this line:
    add_global_table('_wpmu');

    2) How many blogs are you expecting to have? 4096 may be overkill unless you plan on a massive number of blogs.

    As for the move-blogs.php problem, is the password the same for all of your databases including the old one (dapnet_wpmu)?

    Also, are there any errors in your MySQL error log?

    Thanks,
    Andrew

  • dapadoo

    1) Do you have a table called wp_wpmu? I'm asking because of this line:
    add_global_table('_wpmu');

    NO

    2) How many blogs are you expecting to have? 4096 may be overkill unless you plan on a massive number of blogs.

    Having read all the post I could find on this I determined I wanted to go all out and do the 4096 because eventually I'd like to see several 100,000 blogs, groups and forums. I may be a 2-4 years from reaching my goal but I don't want to have to increase databases and have the extra cost and headaches along the way.

    As for the move-blogs.php problem, is the password the same for all of your databases including the old one (dapnet_wpmu)?
    yes

    Also, are there any errors in your MySQL error log?

    No error, I found the error the 500 error earlier was because I was tryin to use different extention to the domain. .com instead of .net I'm setting up the .net as my test sight before I set up on my live site. Both are new installs

  • Andrew

    Hiya,

    The "Global Tables" section allows you to configure tables that will need to reside in the global db. For example, if you're using our post indexer plugin those tables will need to be added as global tables.

    Also, just double checking on this (don't shoot me for asking). Are you sure you checked the MySQL error log and not some other log? If you're running the script and nothing is happening then there should be an error indicating why. Also, check the PHP error log for errors.

    Thanks,
    Andrew

  • dapadoo

    Also, just double checking on this (don't shoot me for asking).

    I wouldn't do that, i'm sure I'll need more help from you, besides I'm still learning about mysql databases

    Are you sure you checked the MySQL error log and not some other log? If you're running the script and nothing is happening then there should be an error indicating why.

    It is now apparent to me I didn't check the MYSOL error log as I'm not sure where to find it. An error log was created and shows up in the same folder as move-blogs.php. The error I found is below

    [22-Feb-2010 22:14:53] PHP Warning: mysql_connect() function.mysql-connect]: Access denied for user 'dapnet_wpmu'@'localhost' (using password: YES) in /home/dapnet/public_html/wp-content/scripts/move-blogs.php on line 64

    Also, check the PHP error log for errors

    Not sure which one is above, If either.

  • Andrew

    Hiya,

    It is now apparent to me I didn't check the MYSOL error log as I'm not sure where to find it.

    The location varies by host. It's best to ask them.

    [22-Feb-2010 22:14:53] PHP Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'dapnet_wpmu'@'localhost' (using password: YES) in /home/dapnet/public_html/wp-content/scripts/move-blogs.php on line 64

    Ah, there we go. Basically that error is stating that the user information (username or password) is incorrect.

    21-Feb-2010 23:53:15] PHP Fatal error: Call to undefined function add_dc_ip() in /home/dapnet/public_html/wp-content/db-config.php on line 16

    Just ignore that for now. It looks like db-config.php got called somehow.

    Thanks,
    Andrew

  • dapadoo

    Ah, there we go. Basically that error is stating that the user information (username or password) is incorrect.

    With that info I checked and the username and password are correct. So I checked the mysql databases and found when I ran sql to build databases it didn't assign the user name to the databases. So move-blogs.php isn't able to connect because there isn't a user name assigned to the new databases. DUH on my part, I should have caught that long ago.

    below is the configuration for sql file from first post. For the globaluser I should have put dapnet_wpmu instead of wpmu

    Is there an easy fix for this mistake? Thoughts of what I need to do besides start over....

    // 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('000', 'dc1', 1, 1,'localhost','localhost', 'dapnet_wpmu_000', 'wpmu', 'xxxxxxxx');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.