
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?
—Update—
Mike Schinkel from LinkedIn says:
Multisite is a plugin you have to enable. The database layouts should pretty much stay the same as you had before.
…
I’m pretty sure regular sites will upgrade as non-multisite and WPMU sites will upgrade as multisite, and you’ll get the choice during new installations.
That’s my guess too.
It seems MU is the mistress who moved in with the wife, $table_prefix, yet each pretends the other doesn’t exist. They seem to have opposing interests (user-generated content vs. edited content) yet both bring (multi-site) children.
Personally, I’d like to see MU swept under the rug. But I don’t think that’s going to happen. User-generated content brings in lots of cash. Edited content costs more to produce.
(__)
`
Here’s my follow-up post:
http://wp-fun.co.uk/2010/06/20/residue-of-wordpress-mu/
(__)
`
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.