** Update** Skip to the comments. One Assumption on my part led to a lot more work than is needed. This guide does work, but as Ron (@wpmuguru) pointed out, I went around the block to just go next door. Even smart people are dumb sometimes ![]()
The WordPress 3.0 betas are kicking around and for projects still in development, upgrading now will save you the trouble later after the site is in production. Upgrading Single Site WordPress installs to 3.0.x is as easy as ever, but now that WordPress µ has been rolled into the main WordPress code base it takes a bit more work to “cross-grade” to the new WordPress 3.0 Multi-Site features.
This is a rough guide to upgrading WordPress MU 2.9.x to WordPress 3.0 Multi-Site. That means that I’m largely pulling this from recent memory and may skip a step or state something inaccurately. Feel free to heckle correct me in the comments.
- Get a copy of WordPress 3.0 via Subversion.
- When I tried to reuse my MU-style wp-config.php (even after adding WP_ALLOW_MULTISITE) I got a number of strange errors, so I recommend starting a fresh wp-config.php based on the wp-config-sample.php file that comes with WP 3.0
- Add this to your wp-config.php file to enable Multi-Site:
define('WP_ALLOW_MULTISITE', true); - Copy over your DB Settings and the security SALT constant definitions. Double check these, I had to add another one called NONCE_SALT that I wasn’t in my original wp-config file. Don’t forget to upload your changes.
- Remove the wp-content/blogs.php file. You’ll be prompted later if you don’t.
- Now this is where it got tricky. In order to get WordPress to enable Multi-Site you have to kick off the process from WP-Admin > Tools > Network, but our table structure is all wrong since we were on WP-MU. Export your DB to a SQL file (Structure+Data), and find all of your wp_1_* tables (assuming your table prefix is wp_).
- Run a search and replace operation and change wp_1_ to wp_ in your sql file. Remove everything else.
- Then import the renamed tables and data back into your DB. You won’t have to remove or do anything to the original tables.
- Now you need to do a little DB hacking. Find your user by ID in the wp_usermeta table, and find the entries that have an option name that starts with wp_1_*.
- Add new keys using wp_* as the option names, and copy the values from their wp_1_* counterparts. This will ensure you have privileges on your own blog.
- Log in to WP-Admin. You should be greeted with the familiar Database Upgrade Required dialog. You may or may not also be prompted to repair your database. If you are, run the repair operation and try the Upgrade again.
- Once logged in, go to Tools > Network and activate your Multi-Site features. It should recognize that you have a network already, and prompt you to update your wp-config.php with additional constant definitions and to replace the WordPress rewrite rules in your .htaccess file.
After all that, you should be good to go. Remember that your mileage may vary and make good backups of everything before proceeding. If you know of an easier way to do this, let me know in the comments.
Eric thanks for the post, it has a lot of great detail!
This may also prove helpful: http://codex.wordpress.org/Create_A_Network
I just posted a guide to upgrade from WordPress MU 2.9.2 to WordPress 3.0 beta2 with multi-site. You can find it at http://developersmind.com/2010/05/12/upgrading-wordpress-mu-2-9-2-to-wordpress-3-0-with-multisite/
You make it look so easy! I didn’t have any where near that smooth of an experience, and that’s what prompted this guide.
Looking at the actual install process, I’m wondering if you just needed to add
define( 'SITE_ID_CURRENT_SITE', 1 );to the wp-config file rather than have to do the changes to the base database tables and prefixes.define( 'BLOG_ID_CURRENT_SITE', 1 );
I haven’t actually done an upgrade yet, and just installed 3.0 and enabled the multisite so at this point, it’s purely conjecture.
Michael,
You may be on to something…
I’ll be going over everything you need to cover on upgrades when we get an official release out. (and I can retest it again and again & try and break it).
Thanks Andrea. I appreciate the time you’ve already put into WP-MU/WP 3.0, and look forward to the release.
Eric, sorry you went around the block to get to next door :/
The MULTISITE constant is only for switching from WP to a WP Network. It’s not for upgrading MU installs. You didn’t mention the MULTISITE constant but your upgrade process only works if you had added that to your wp-config.
If you don’t add the MULTISITE constant in your wp-config.php, then you can just replace the MU files with the WP 3.0 files & make the htaccess edit that Pete described in his post.
Yeah, I had added that constant to my wp-config.php in preparation for visiting the recently upgraded files, thinking it was required to enable the network feature (like it is on Fresh Installs) and this rough guide is the result of that thinking.
A wise man once said: “Assumptions are the root of all software defects”, and in this case created quite a bit more work for me than is necessary.
I’ve got another MU site that’s about to ship. I’ll try the upgrade again with the proper instructions and see if I can’t get it done in 1/30th of the time it took me the first time.
Thanks for chiming in on the thread, Ron!