Convert existing site to network

We have an existing WP3 site and would like to make it multiuser instead of the multiple installs we have now.

I add the WP_ALLOW_MULTISITE code and relaunch – start the Network and then add the multisite code to wp-config.php and .htaccess. As soon as I do that and log out – it no longer finds a database connection. I noticed on previous attempts that a network database has a wp_blogs table, and several other tables, where a standard install doesn’t have that. I’ve checked all our other sites and databases. Is there more to do?

Read More

We have our main site with another independent install within it that handles press releases. I’m looking to consolidate to one and need the separate permalink structure (the second install puts the posts at /resources/media_center/pr).

Related posts

Leave a Reply

3 comments

  1. Don’t try to convert an existing site.

    What you’ll want to do is set up a new site with a clean installation of WordPress. Most of the networks I’ve started are subdomains along the lines of http://network.blog.url or http://dashboard.blog.url. The first site you set up will become the dashboard site for the rest of the network … that’s why you want to start with a clean site.

    Setup

    First, install WordPress normally. You’ll need a fresh database and a fresh download of WordPress 3.0.3.

    Next, add define('WP_ALLOW_MULTISITE', true); above the line that says, /* That's all, stop editing! Happy blogging. */ in wp-config.php.

    Now, go back to your site and go to Administration » Tools » Network to activate the network installation. You’ll be given some additional information for wp-config.php … copy this code in between where you wrote define('WP_ALLOW_MULTISITE', true); and where it says /* That's all, stop editing! Happy blogging. */. Don’t change anything else in the config file.

    Edit your .htaccess file and replace all other WordPress rules with the rules the network installation page gave you.

    At this point, you’ll need to log back in to the site, but once you do you’ll have a working multi-site installation.

    Migrate Other Sites

    Now you’ll want to begin migrating your other sites. Start with the main site and create a new “Site” from within WordPress. You’ll have to copy over a bunch of settings manually, but you can probably get it looking right fairly quickly.

    Export your posts and pages from the old site and import them to the new one.

    Copy your theme over and any plug-ins you want to use.

    If you only have a handful of users, it might be easier to ask them to sign back up once the site’s moved. You can transfer users from the old site to the new site directly through the database … but this involves writing SQL queries to export your old wp_users table, clean out database-specific information (i.e. ID), and write another query to import them into the new database. Doable, but time-consuming.

    Once the first site’s migrated, start with the next one.

    Domain Mapping

    If your multiple sites were originally on multiple domains, you’ll want to install a domain mapping plug-in to make everything work right. I recommend (and use on all my sites) the WordPress MU Domain Mapping plug-in.

    Take a deep breath

    I know this sounds like a lot and it can be intimidating, but it’s possible. I migrated a 12-blog network with 1400 users last month. Last night I migrated a 5-blog network. Both take about the same amount of time and follow the exact same process I outlined above. Don’t worry, you’ll make your way through it.

    If you lost your database connection on your first attempt it’s probably because you overwrote something in wp-config.php by mistake. I’ve had a few times where opening that file in Notepad has stripped all the whitespace from the ends of lines, breaking the file and killing my database connection.

    This is the very reason why the very first instruction in any of the WordPress documentation regarding updates or migration is to back up your database and files.

  2. Time has passed, luckily we have more advanced tools available now. So I just want to add, migrating can be done much nicer and easier now by using WP-CLI and the WP-CLI plugin MU-Migration. Most people likely have to install at least the latter, maybe even both, consult the documentation for that.

    Afterwards exporting can look like:

    wp mu-migration export all site.zip --plugins --themes --uploads
    

    And importing:

    wp mu-migration import all site.zip
    

    Of course this is the most basic rundown, more parameter are available. The documentation is informative straightforward. Obviously backups are mandatory for any crucial operation. In sum those are great tools, which can make your life much easier.