Multi-db 3.0.2

Hi all

I uploaded version 3.0.2 of the multi-db plugin late last night. This is a bug fix version of the plugin and you should upgrade to this version even if you haven’t (yet) seen the error.

Rgds

Barry

  • Barry
    • DEV MAN’s Mascot

    @bdonaghy – what version of WPMU are you on? – You ideally need to be on 3.0+ for the 3.0 branch of multi-db – though if you could let me know the error / problem you are having then I may be able to work out what’s happening.

  • gnagel
    • New Recruit

    I added define(‘DB_NAME’, ‘mydataname_global’:wink:;

    to config.php and seamed to fix the 3.0.2 error

    I updated from 2.7 to 2.9 wordpress mu to 3.01 wordpress, for the latter 2 2.7 and 2.9 using multi db you don’t have to define your database name in the config.

    I am hoping this is the correct fix for the issue

  • gnagel
    • New Recruit

    Yes I know I did that

    My point was not with a clean install but with an upgrade from 2.7 to 3.1

    In 2.7 your config did not need to point to DB_NAME’, ‘mydataname_global’ you actually could keep that field blank and it would still work with multi settings.

    my old config from 2.7 wordpress mu

    // ** MySQL settings – You can get this info from your web host ** //

    /** The name of the database for WordPress */

    //define(‘DB_NAME’, ”:wink:;

    /** MySQL database username */

    define(‘DB_USER’, ‘xxxxx’:wink:;

    /** MySQL database password */

    define(‘DB_PASSWORD’, ‘xxxx’:wink:;

    /** MySQL hostname */

    define(‘DB_HOST’, ‘xxxxxx’:wink:;

    /** Database Charset to use in creating database tables. */

    define(‘DB_CHARSET’, ‘utf8’:wink:;

    /** The Database Collate type. Don’t change this if in doubt. */

    define(‘DB_COLLATE’, ”:wink:;

    define(‘VHOST’, ‘no’:wink:;

    $base = ‘/’;

    define(‘DOMAIN_CURRENT_SITE’, ‘service.columbia.k12.mo.us’ );

    define(‘PATH_CURRENT_SITE’, ‘/’ );

    define(‘BLOGID_CURRENT_SITE’, ‘1’ );

    above worked with version 2.7 fine because it didn’t need database name in main config file

    with version 3.01 and multi db 3.02 you have to once again define the database in the config file or you will get the error I’m guessing that bdonaghy and myself had because actually 2.9.0 also doesnt need this information.

    I might suggest in upgrade instructions (not clean install since clean install you won’t be pulling from old site with old wp-config.php file ) from 2.9 and lower from mu using multi database plugin that you be sure that you once again define database name in the wp-config.php file. Since if they are running it and dowload 3.0.1 and overwrite the db.php with the newer version without updating their wp-config.php the error will appear.

    My steps for an IIS install (for updating 2.7 using multi db plugin, not new install please use a new install guide for that)

    Download wordpress 3.0.1

    Copy and replace all old wordpress files

    wp-config.php won’t wont be rewritten cause nothing to overwrite it with

    replace dp.php and move-blogs.php as instructed, don’t replace dp-config.php

    open wp-config.php and make sure you ad back the

    define(‘DB_NAME’, ‘mydataname_global’:wink:; line

    Very important!!! rewrite rules have changed with 3.0.1

    If running IIS 7 dowload IIS rewrite module its free

    Download x86 http://go.microsoft.com/?linkid=9722533

    Download x64 http://go.microsoft.com/?linkid=9722532

    Install module

    In IIS go to root site and you will see a new group icon called URL rewrite, open it and choose import rule

    import

    #uploaded files<br />
    RewriteRule ^(.*/)?files/$ index.php [L]<br />
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*<br />
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]<br />
    # add a trailing slash to /wp-admin<br />
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$<br />
    RewriteRule ^(.+)$ $1/ [R=301,L]<br />
    RewriteCond %{REQUEST_FILENAME} -f [OR]<br />
    RewriteCond %{REQUEST_FILENAME} -d<br />
    RewriteRule . - [L]<br />
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]<br />
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]<br />
    RewriteRule . index.php [L]<br />
    <IfModule mod_security.c><br />
    <Files async-upload.php><br />
    SecFilterEngine Off<br />
    SecFilterScanPOST Off<br />
    </Files><br />
    </IfModule><br />

    Hit apply

    delete old .htaccess files don’t need with IIS7 its all saved to web.config file

    If using older version of IIS you will need to purchase IISMOD rewrite from Micronove and add the new rewrite rules above for it to work.

    Update should be complete

  • Barry
    • DEV MAN’s Mascot

    @gnagel

    My point was not with a clean install but with an upgrade from 2.7 to 3.1

    In 2.7 your config did not need to point to DB_NAME’, ‘mydataname_global’ you actually could keep that field blank and it would still work with multi settings.

    The upgrade to 3.0 required this change due to the way in which the new version extends the main wp database class rather than overriding it, it has been mentioned a few times and in a number of threads, but I’ll place it in the upgrade instructions as well.

  • Barry
    • DEV MAN’s Mascot

    @bdonaghy – read two posts up – the 3.0 multi-db changed the method of enabling multi-db, it now extends the existing wp database class, rather than overrides it. Because of this the connection information in wp-config.php MUST be correct as well – you should set that to connect to your global db, which is going to be used at some point on a page load anyway.

  • Barry
    • DEV MAN’s Mascot

    @bdonaghy – if you have the db.php file (and the db-config.php file) in the correct place and aren’t getting any errors – then it’s working, wp looks for the db.php file now and loads that *instead of* its normal database class. Multi-db then loads and extends the original by itself, so if you are getting blog content and those files are in the correct places, multi-db is working fine.