Issues with upgrade from WPMU v2.9.2 to WP v3.0.1
-
Having some issues with upgrading to v3.0.1. It is partly related to a plugin called “W3 Total Cache” but I believe it more relates to the WP upgrade though.
I apologize but this is a LONG post. But please bear with me. The reason is to provide as much detail to hopefully help resolve the issues.
I been using WPMU from I believe v2.7.x-ish (can’t be sure) and having been doing the Automatic install via the admin. And so far no issues till now.
(1) The first issue is that it seems to be that it partly does not know it is a multi-site.
W3 Total Cache is not activated using the “site-wide/network wide” activation. It is individually activated per blog (as recommended by the author).
The plugin normally will make an config and cache directory PER BLOG in “wp-content”. However it did not. It only made only one config and one cache directory because it thinks it is a single blog not a multi-site.
It seems the issue is the DEFINEs in “wp-config.php”. I see that I still have the old WPMU values. The installer did not mention anything to add except I believe the NONCE define IIRC.
define('VHOST', 'no'); $base = '/'; define('DOMAIN_CURRENT_SITE', 'blogs.domain.com' ); define('PATH_CURRENT_SITE', '/' ); define('SITE_ID_CURRENT_SITE', 1); define('BLOGID_CURRENT_SITE', '1' );
After installing a temporary fresh WP v3.0.1 to do a comparison, I find that there are these additional configs for using multi-site in WP v3.
define('WP_ALLOW_MULTISITE', true); // I believe this just enables the option in the admin. define( 'SUBDOMAIN_INSTALL', false ); // I believe this replaces VHOST above. define( 'BLOG_ID_CURRENT_SITE', 1 ); // I believe this is just to use the correct naming (blogid vs blog_id) //define( 'MULTISITE', true ); // I believe this is what tells it is a multisite
Now the last line above is what I need. I believe W3 Total Cache is using the correct functions like “is_multisite()” to determine if it is a multi-site or not which I believe just checks the DEFINE.
However adding this line to my upgraded blog (that was previously a WPMU install) breaks the site. I get a non-useful “Error establishing a database connection”. Googling around I find this thread “https://www.ads-software.com/support/topic/upgrading-from-291-wpmu-to-301-problem-with-database-tables?replies=12”, and I believe it is correct.
WP v3 puts the main blog in the normal “wp_”, however WPMU placed the main blog in “wp_1_”. The upgrade process did not seem to do this. I did click the “Update Network” in the admin just to be sure if I missed anything.
Doing the rename of tables from “wp_1_” to “wp_” as suggested in the thread allows me to enable the “MULTISITE” define. As well, this also fixes W3 Total Cache. W3 Total Cache now makes a separate config file and cache directory for each of my blogs.
(2) However there is another issue.
In my main blog (eg. the first blog), I have a custom page where it basically pulls the 1st post of all blogs in updated order. Here’s the code…
$blogs = get_last_updated(); if ($blogs) { foreach ($blogs as $blog) { switch_to_blog($blog['blog_id']); query_posts('posts_per_page=1'); if (have_posts()) { echo get_blog_details($blog['blog_id'])->blogname; include (TEMPLATEPATH.'/the_loop.php'); } wp_reset_query(); restore_current_blog(); } }
Now the code works fine after the upgrade. I see each post, however, the line where it gets the blog name (get_blog_details), is not correct. It only grabs the blog name of the 1st main blog. It is not getting the individual blog names.
However, disabling W3 Total Cache, and the blog names are fine. Now here’s comes the weird part, I put the same code in that “fresh” WP v3.0.1 mulit-site installed with the plugin enabled and the code works perfectly.
So at this point I thought, maybe the installer missed something. So I deleted “wp-admin”, “wp-includes”, all the root files except “wp_config.php” and “.htaccess”, and copied a clean v3 install over. However the issue is still there.
So I try to debug it, I put a “print_r(get)blog_details($blog[‘blog_id’]);” to see what I get and here’s one of the blogs…
[blog_id] => 13 // correct [site_id] => 1 // correct [domain] => blogs.domain.com // correct [path] => /subblog/ // correct [registered] => 2010-03-05 08:53:11 // correct [last_updated] => 2010-09-14 15:04:17 // correct [public] => 1 // correct [archived] => 0 // correct [mature] => 0 // correct [spam] => 0 // correct [deleted] => 0 // correct [lang_id] => 0 // correct [blogname] => Main Blog // INCORRECT [siteurl] => https://blogs.domain.com // INCORRECT [post_count] => 1 // INCORRECT
The last 3 values are incorrect. It is grabbing the main blog instead of blog_id 13. Looking in get_blog_details(), these 3 values are being grabbed by calling get_blog_option(). But looking at that code and it seems correct.
Also disabling W3 Total Cache fixes it HOWEVER the fresh WP v3 install can do it fine with W3 Total Cache on which is strange.
I even disabled ALL the features of W3 Total Cache (so that it should be technically off) but it still occurs. Only turning off the actual plugin fixes it.
So I can’t tell if this is a WP issue, plugin issue or a database issue. I am leaning more on database currently though because that is the currently what is different from the WPMU upgraded blog and the fresh v3.0.1 install (code-wise both have the same WP files and W3 Total Cache files).
Any help?
- The topic ‘Issues with upgrade from WPMU v2.9.2 to WP v3.0.1’ is closed to new replies.