• I’m thinking about upgrading 9 blogs and a couple of plugins I wrote. They all depend on $table_prefix, which you all know is in wp-config.php since before Matt was Ma.tt.

    Yes, I know WP 3.0 is multi-site. I’ve been using the recommended $table_prefix for several years now. Yes, it’s time to upgrade. Which is why I’m here. So what is the recommended way now to get all my data working with WP 3.0? I have millions of records stored in MySQL using $table_prefix.

    Instead of using 9 wp-config files (doh!) I came up with this really simple way of using the same wp-config.php for all of my blogs:

    $table_prefix = substr(str_replace(“-“, ”, $_SERVER[‘HTTP_HOST’]), 0, 4) . ‘_’;

    The dash deal was added later for my “wp-fun.co.uk”

    In plain English, this code simply uses the first four letters of the domain name for the $table_prefix. So for example, Knowingart.com would be “know_” instead of “wp_”. I use this same technique for all my plugins.

    So a Knowingart.com plugin would use “know_myplugin” to store information, etc.

    What do you think? Can I safely upgrade to WP 3.0?

Viewing 1 replies (of 1 total)
  • Thread Starter PJ Brunet

    (@knowingart_com)

    I could backup my database and all of the files. And then do the upgrade and see what happens.

    But I’d really like to know what I’m getting into. I want to know the philosophy of this MU-3.0 merger. (No, I wasn’t at WordCamp.)

    I heard WP 3.0 only uses one set of plugins for multiple blogs–Is this default behavior or only if you activate multi-site? How do plugins know if the blogger is using multi-site or not? Does it matter?

    Also, what happens to my options and posts? Are they merged into one table? Does the upgrade tool merge our options? I also have an options duplication plugin–so this further complicates things.

Viewing 1 replies (of 1 total)
  • The topic ‘How does $table_prefix fit into WP 3.0? Upgrading 9 blogs and plugins.’ is closed to new replies.