MultiDB - still using old DB?

Hiya guys

Wondering why MultiDB still uses old database after being installed and configured.
Is this normal?

  • VentureMaker
    • Site Builder, Child of Zeus

    Barry,
    Installed it as usual :slight_smile:
    db.php and db-config.php are in /wp-content/
    Used move-blogs.php to copy tables from old DB into new DBs.

    Everything seems to work fine, tables of new blogs are being created in new DBs, content of existing blogs is also being added into new DBs.

    However if I remove old DB - my WP shows database connection error.

    Also, here:

    mysql> show processlist;
    +-------+--------------+-----------+---------------+---------+------+-------+------------------+
    | Id | User | Host | db | Command | Time | State | Info |
    +-------+--------------+-----------+---------------+---------+------+-------+------------------+
    | 86392 | root | localhost | NULL | Query | 0 | NULL | show processlist |
    | 86453 | old_db_user | localhost | old_db | Sleep | 0 | | NULL |
    | 86454 | new_db_user | localhost | new_db_global | Sleep | 0 | | NULL |
    +-------+--------------+-----------+---------------+---------+------+-------+------------------+
    3 rows in set (0.00 sec)

    Any ideas why it still needs old DB but actually works with new DBs?

  • Barry
    • DEV MAN’s Mascot

    @venturemaker - set the database details in wp-config.php to point to your new global database and you'll be fine. For version 3.0 of the multi-db onwards you need to have valid db details in both the db-config.php and wp-config.php due to the way the new multi-db code works (it extends the existing db class now instead of replacing it completely).

  • VentureMaker
    • Site Builder, Child of Zeus

    Barry,

    We have 2 installs at the moment where I'm tracking this.

    1. WP 3.0 with MultiDB 3.0 installed with 16 databases option.
    2. WPMU 2.9.2 with MultiDB 2.9.2 (modified to solve issues described here https://premium.wpmudev.org/forums/topic/chinese-character-support) installed with 4096 databases option.

    OK, so you're saying all I have to do is to change DB details in wp-config.php to use new_db_global database.

    Will do and report back here :slight_smile:

  • VentureMaker
    • Site Builder, Child of Zeus

    Thanks, Barry, everything is cool.

    Also, I assume define( "WP_USE_MULTIPLE_DB", false ); should be left as is, right?

    BTW, I've been always wondering why wp-config.php doesn't ever have a closing PHP tag (?>:wink: in the end? :slight_smile:

  • Barry
    • DEV MAN’s Mascot

    @venturemaker
    Yep, leave the multi-db define as it is (if that define doesn't exist we set it to false in the db anyway).

    the WP3 multi-db plugin should now be future (and backwards) compatible with wp now so, fingers crossed, upgrading shouldn't be an issue anymore either.

    The missing closing PHP tag is a little hack they've introduced to prevent any potential white space at the end of those files that people would be inclined to edit. It basically means that instead of telling the PHP parser that it's finished, it just lets it drop off the end of the file.

    More here:
    http://blog.rogeriopvl.com/archives/php-files-closing-the-php-tag-or-not/

    I, personally, don't like it but as long as it's doing no harm...

  • VentureMaker
    • Site Builder, Child of Zeus

    Thanks again, Barry

    One last question here.
    Having WPMU 2.9.2 and MultiDB 2.9.2 (modified) - what's the correct order to go to WP 3.0?
    Should we upgrade WP to 3.0 first, or MultiDB to 3.0 first?

    I assume we should upgrade WPMU 2.9.2 to WP 3.0 first, then transfer modifications from current MultiDB to MultiDB 3.0 and then replace MultiDB files. Am I thinking correctly? :slight_smile:

  • Barry
    • DEV MAN’s Mascot

    Make sure your wp-config.php database settings for the 2.9.2 are correct (i usually point it to my global be) then I would replace multi-db with the newest version, confirm that the wpmu 2.9.2 install is still working (should be no problem running the newest multi-db with 2.9.2).

    Then upgrade to wp 3.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.