Multi-DB Tables Copied Successfully but won’t run

Hi,

Hey, I just set up a 256 DB version of Multi-DB. on WPMU v2.6.3 using the latest control

Man, that was a LOT of work :slight_smile:

As my last step I copied over db.php and db-config.php

Now it’s dying in wpmu_settings.php function wpmu_current_site

die( “No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance.” );

At that point I echoed out the following vars

Sitedomain=[com],currentsite=[]

When I rename db.php to db.ZZZphp it all works fine again.

I am using a lot of domain mapping.

Any ideas what to check next?

Thanks,

..Mike

  • mikee17
    • Site Builder, Child of Zeus

    Andrew,

    Oops.. I assumed the 2.7 version also worked for 2.6

    Ok… I installed the 2.6 stuff, but it still does the same thing.

    I believe db-config.php is setup correctly. move-blogs.php ran without a hitch.

    Ideas?

    ..Mike

  • Andrew
    • Champion of Loops

    Hiya,

    move-blogs.php doesn’t depend on anything in db-config.php. It depends on the settings you configure at the top of the script.

    Can you please post the contents of your db-config.php with the passwords masked (****)? Since you’re using 256 databases just post a selection of the connection lines.

    Thanks,

    Andrew

  • Andrew
    • Champion of Loops

    Hiya,

    Try these changes:

    Change this:

    add_db_server(’00’, ‘dc1′, 1, 1,’127.0.0.1′,’208.69.123.125’, ‘xyzxyza_wp_00’, ‘u_wp_00’, ‘***********’:wink:;

    To this for all lines:

    add_db_server(’00’, ‘dc1′, 1, 1,’127.0.0.1′,’127.0.0.1’, ‘xyzxyza_wp_00’, ‘u_wp_00’, ‘***********’:wink:;

    Also, remove these lines:

    add_global_table(‘blog_versions’:wink:;

    add_global_table(‘blogs’:wink:;

    add_global_table(‘domainmapping’:wink:;

    add_global_table(‘registration_log’:wink:;

    add_global_table(‘signups’:wink:;

    add_global_table(‘site’:wink:;

    add_global_table(‘sitecategories’:wink:;

    add_global_table(‘sitemeta’:wink:;

    add_global_table(‘usermeta’:wink:;

    add_global_table(‘users’:wink:;

    Thanks,

    Andrew

  • drmike
    • DEV MAN’s Mascot

    add_global_table(‘blog_versions’:wink:;

    This and the following 8 or so lines, delete. Those are the default global lines and are not needed. They also contain special, non ansi characters (ie fancy quotes probably) which may be causing the issue.

    add_global_table(‘demo_ips’:wink:;

    add_global_table(‘vn_user_membership’:wink:;

    Just top verify, all of the tables in this section have a prefix attachech to their names, right? The reason I ask is looking at the last line there, the name of the table would be wp_vn_user_membership

    u_wp_00

    Not an issue but I believe most of us are using the same mysql user for all of this. From that column, I’m seeing a different user for each and every database. Is that correct?

    That’s what I see right off. My money is on those non-ansi characters causing a lot of the issue.

  • mikee17
    • Site Builder, Child of Zeus

    drmike,

    Ok.. I have updated the http://videoniche.info/mikedb-config.txt with my latest non-working version.

    You may need to refresh a few times.

    The tables listed below are NOT wp_XXXX. Their actual names are ‘demo_ips’… ‘vn_user_membership’, etc..

    add_global_table(‘demo_ips’:wink:;

    ….

    add_global_table(‘vn_user_membership’:wink:;

    These tables are used by other programs on my WPMU install.

    I created a separate user and password for each DB. It was a HUGE amount of work to do that too. :slight_frown:

    …Mike

  • drmike
    • DEV MAN’s Mascot

    These tables are used by other programs on my WPMU install.

    That’s part of the problem as both wordpress and the multidb expects there to be a prefix there. You’re going to have to go back and add in wp_ (or whatever prefix you;re using. wp_ is the standard default) to those table names. demo_ips will become wp_demo_ips, etc.

    Do not change the config file though. It’s where it should be with those table names.

    Also make sure that those mysql users have access to their respective database tables. If you;re on cpanel, that;s an extra step on their backend. (One of the reasons why most of just just use a single db user for everything.)

    ‘localhost’,’localhost’

    That’s the only other thing I see. I know on our installs, we replace one of those with the actual ip address of the server just to cover all bases. There’s a number of hosts out there that don;t allow access to mysql via ‘localhost’ and you have to actually use either the ip address of the mysql server or the working name of it.

    Please also make sure that wp-blogs and the other global tables are in the global database and blog 1’s tables are in c4 database.

  • Andrew
    • Champion of Loops

    Hiya,

    If these tables aren’t for WP/WPMU plugins then you can remove them:

    add_global_table(‘demo_ips’:wink:;

    add_global_table(‘demo_slots’:wink:;

    add_global_table(‘domaininfo’:wink:;

    add_global_table(‘site_categories’:wink:;

    add_global_table(‘site_subdomains’:wink:;

    add_global_table(‘vn_SitemapXML’:wink:;

    add_global_table(‘vn_config’:wink:;

    add_global_table(‘vn_daily_stats’:wink:;

    add_global_table(‘vn_ebay_products’:wink:;

    add_global_table(‘vn_membership_products’:wink:;

    add_global_table(‘vn_news’:wink:;

    add_global_table(‘vn_site_categories’:wink:;

    add_global_table(‘vn_user_aff’:wink:;

    add_global_table(‘vn_user_membership’:wink:;

    Only tables accessed via WPMU through the WPDB class need to be listed.

    I’m really not seeing any major mistakes though. When I visit videoniche.info I get this error:

    “Error establishing a database connection”

    If that’s the correct domain for your site then that would indicate something is wrong with the db connection details.

    I’d switch to just one user for all databases until you get this working.

    Thanks,

    Andrew

  • mikee17
    • Site Builder, Child of Zeus

    drmike…

    Yes, blog1 is in the c4.

    We always attach to MySQL using localhost. That’s how I granted rights. Our dedicated server doesn’t use CPanel, but some other panel.

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

    Andrew….

    I remarked out those files mentioned above.

    This isn’t the domain that WPMU is on. I think Google indexes this forum every 10 minutes and I don’t really want my domain popping up on page 1 :slight_smile:

    You can see the domain on top of the .txt file above.

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

    Something else…

    Right now I have renamed db.php to dbZZZ.php so everything is running.

    As soon as I rename it to db.php it can’t find the site. and variable Sitedomain = “com”

    We have a db.php script on the root of this domain. I tried temporarily changing it’s name while multi-db was active (db.php) but it didn’t make a difference.

    One thing that confuses me is

    add_dc_ip(‘208.69.123.’, ‘dc1’:wink:;

    What’s that all about? Does my server need something special to handle that?

    ..mike

  • joshmac
    • Site Builder, Child of Zeus

    Not sure if you fixed your issue, but looking at the .txt file above, is there something wrong with the “vip1” database line or maybe you are missing this line at the end “add_vip_blog(1, ‘vip1’:wink:;”?

  • mikee17
    • Site Builder, Child of Zeus

    Hi joshmac,

    Not sure if you fixed your issue, but looking at the .txt file above, is there something wrong with the “vip1” database line or maybe you are missing this line at the end “add_vip_blog(1, ‘vip1’:wink:;”?

    That was just an example. we’re not using it.

  • Andrew
    • Champion of Loops

    Hiya,

    As soon as I rename it to db.php it can’t find the site. and

    variable Sitedomain = “com”

    Sounds like there’s a problem in the db. Did you check in the databases to make sure the tables were copied correctly?

    One thing that confuses me is

    add_dc_ip(‘208.69.123.’, ‘dc1’:wink:;

    What’s that all about? Does my server need something special to handle that?

    That bit is setup correctly.

    Thanks,

    Andrew

  • mikee17
    • Site Builder, Child of Zeus

    ok… So we have figured out what’s going on.

    It is trying to run the SQL “SELECT * FROM wp_site WHERE domain = XXXX AND path = XXXX”;

    but it is connected to [dbname] => XXXXXXX_wp_d4 not XXXX_wp_global where table wp_site resides.

    Why would it be looking there?

    ..Mike

  • mikee17
    • Site Builder, Child of Zeus

    BTW… XXXXX_wp_d4 has the following tables

    wp_600_comments

    wp_600_links

    wp_600_options

    wp_600_postmeta

    wp_600_posts

    wp_600_statpress

    wp_600_terms

    wp_600_term_relationships

    wp_600_term_taxonomy

    wp_728_ar_gwa_leads

    wp_728_ar_gwa_lists

    wp_728_ar_gwa_msg

    wp_728_comments

    wp_728_links

    wp_728_options

    wp_728_postmeta

    wp_728_posts

    wp_728_statpress

    wp_728_terms

    wp_728_term_relationships

    wp_728_term_taxonomy

  • mikee17
    • Site Builder, Child of Zeus

    My guess is that having ‘wp_’ in the database names *and* as the prefix is throwing things off. That’s really just a guess though.

    I went and remade all the ables using a prefix like ‘XXXX_in_00’ to dump the ‘wp_’

    move-blogs.php worked without a hitch.

    But for some reason when it’s looking to run the SQL statement:

    “SELECT * FROM wp_site WHERE domain = XXXX AND path = XXXX”

    it’s connected to the DB XXXXXXX_in_d4 instead of XXXXXXX_in_global where table wp_site is located.

    Why is it attached to DB “d4”??

    Inside we have the “wp_600…” and “wp_728…” tables.

    Ideas?

    Thanks,

    ..mike

  • mikee17
    • Site Builder, Child of Zeus

    Btw, are your main blog tables in xxxxxxxx_in_vip_1?

    No, xxxxxxxx_in_vip_1 is EMPTY, not tables.

    <b>What’s supposed to be in xxxxxxxx_in_vip_1?</b>

    All the other DBs have tables excpect xxxxxxxx_in_de

    xxxxxxxx_in_global has 26 tables

    demo_ips

    demo_slots

    demo_slots20090114

    domaininfo

    site_categories

    site_subdomains

    vn_config

    vn_daily_stats

    vn_ebay_products

    vn_membership_products

    vn_membership_productsBACKUP20090123

    vn_news

    vn_SitemapXML

    vn_site_categories

    vn_user_aff

    vn_user_membership

    wp_blogs

    wp_blog_versions

    wp_domain_mapping

    wp_registration_log

    wp_signups

    wp_site

    wp_sitecategories

    wp_sitemeta

    wp_usermeta

    wp_users

    The plot thickens! :slight_smile:

    Thanks,

    ..Mike

  • mikee17
    • Site Builder, Child of Zeus

    Andrew,

    If you could share your 2.6.3 config file, that might help. I could compare what I see there with my config.

    Also, when I GRANTed rights, I gave all rights MINUS DROP. I didn’t think that would be a problem.

    Just trying to think of ANY reason this might not be working.

    ..Mike

  • mikee17
    • Site Builder, Child of Zeus

    When I had someone look at my db-config.php, he said I need to add the following:

    add_global_table(‘domain_mapping’:wink:;

    Could that be the reason it hasn’t been working?

    Does that make sense? Does everyone else using Domain mapping have that in their global table??

    If so are there any other “wp_” files that I need to add to the global table?

    These are my non-numbered “wp_” DBs

    wp_blog_versions

    wp_blogs

    wp_domain_mapping

    wp_registration_log

    wp_signups

    wp_site

    wp_sitecategories

    wp_sitemeta

    wp_usermeta

    wp_users

    It’s a pain in the neck to empty out all 256 DBs, so I want to make sure before I do move-blogs.php again. :slight_smile:

    Thanks,

    ..Mike

  • Andrew
    • Champion of Loops

    add_global_table(‘domain_mapping’:wink:;

    Could that be the reason it hasn’t been working?

    It’s possible.

    Does everyone else using Domain mapping have that in their global table??

    If they don’t then they should.

    wp_blog_versions

    wp_blogs

    wp_domain_mapping

    wp_registration_log

    wp_signups

    wp_site

    wp_sitecategories

    wp_sitemeta

    wp_usermeta

    wp_users

    Looks like the domain mapping table is the only non-wpmu global table. So add that one to db-config.php and you should have it covered.

    For above post, should it be

    add_global_table(‘domain_mapping’:wink:;

    or

    add_global_table(‘wp_domain_mapping’:wink:;

    add_global_table(‘domain_mapping’:wink:;

    Thanks,

    Andrew

  • mikee17
    • Site Builder, Child of Zeus

    Ack…

    After hours of emptying tables and trying again, now I’m getting tons of errors and nothing loads when I make db.php LIVE.

    At least it’s generating errors. Any idea why it’s looking for wp_sitemeta everywhere?

    44: [Tue May 05 21:12:25 2009] [error] WordPress database error Table ‘xxxxxxx_in_36.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘plugin_wp-hashcash’ AND site_id = 1 made by get_site_option

    45: [Tue May 05 21:12:25 2009] [error] WordPress database error Table ‘xxxxxxx_in_36.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘plugin_wp-hashcash’ AND site_id = 1 made by get_site_option

    46: [Tue May 05 21:12:25 2009] [error] WordPress database error Table ‘xxxxxxx_in_fe.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘plugin_wp-hashcash’ AND site_id = 1 made by get_site_option, referer: http://boston-red-sox.xxxxxxxxxx.com/wp-admin/post-new.php?posted=90

    47: [Tue May 05 21:12:25 2009] [error] WordPress database error Table ‘xxxxxxx_in_36.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘plugin_wp-hashcash’ AND site_id = 1 made by update_site_option

    48: [Tue May 05 21:12:25 2009] [error] [client 71.179.43.44] WordPress database error Table ‘xxxxxxx_in_fe.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘plugin_wp-hashcash’ AND site_id = 1 made by get_site_option, referer: http://boston-red-sox.xxxxxxxxxx.com/wp-admin/post-new.php?posted=90

    49: [Tue May 05 21:12:25 2009] [error] [client 66.249.73.1] WordPress database error Table ‘xxxxxxx_in_8d.wp_sitemeta’ doesn’t exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = ‘plugin_wp-hashcash’ AND site_id = 1 made by update_site_option

  • Andrew
    • Champion of Loops

    Hiya,

    Honestly I have no clue what’s causing that. Unfortunately I can’t keep on guessing the problem as it’s an older version of WPMU.

    Can you setup a 2.7 or 2.7.1 test install on 16 databases? I think it might be easier for you to fix your current install if you have a working install to use as a comparison.

    When setting up the test install keep everything very simple. Create one user for all databases (16 + global), do not place the main blog in a vip database, and pay very close attention to the 16 db db-config.php template.

    Thanks,

    Andrew