Cyprich.com

Occasionally Relevant Insights from a Software Builder

By

Transferring WordPress MU to Another Server

Yesterday, we looked at how to transfer WordPress to another server. The multi-user version of this software, WordPress MU, is a bit more involved in switching servers. The database settings still need to be changed, but now you need to change the IP of each blog on the server. Every blog has a unique set of tables in the database and they are named wp_number_, e.g. a table can be named wp_10_categories.

Copy the WordPress Files

Like the standalone alone version of WordPress, you need to copy the program files to the new server. Again, SSH is the preferred and secure way of doing this.

Configure the Database and Base Folder

The wp_config.php file contains the configuration settings for the database and the location of the folder with the WordPress MU program files. Create a new MySQL database and record the database name, the username and password for the database, and host name in the appropriate area below in the config file. Also, set the location of the folder where there program files are in the $base variable. If they are in the root folder, then just use ‘/’. Make the changes where the text is bold.

define(‘DB_NAME’, ‘wordpressmu‘); // The name of the database
define(‘DB_USER’, ‘root‘); // Your MySQL username
define(‘DB_PASSWORD’, ‘password‘); // …and password
define(‘DB_HOST’, ‘localhost‘); // 99% chance you won’t need to change this value
$base = ‘/wordpressmu/‘;

Change the IP for the Administration Site

The administrative section of the WordPress MU needs to be configured. There are 3 tables where information needs to be changed as shown below.

wp_site Table:
Change the domain to your server IP and change path to the location of the WordPress MU program files.

wp_sitemeta Table:
Change meta_value in the site_name record to your IP.

wp_blogs Table:
Change the domain of every blog listed to the new IP. The path needs to correctly point to the individual blogs. The path in the first record will be the same as the $base variable set in wp_config.php. The blogs should have a path similar to /base/blog_1.

Change the IP’s in Each Blog

This is the fun part. Since there are multiple blogs, you need to change the IP in each blog to the new address. The only table that gets modified is wp_options. There are 3 records that get changed: the option_value in siteurl, home, and fileupload_url. Modify these values to your server’s IP and the base folder (if appropriate).

That’s all there is to it! You would be better off automating this process if a large number of blogs were active. A PHP script could go into each blog’s wp_options table and then change the IP.

9 Responses to Transferring WordPress MU to Another Server

  1. Martin says:

    Hi Johan,

    have you found or written such a script?

    Greets Martin

  2. Johan says:

    Hi Martin. I haven’t written the script yet, but I should do it soon since I have to transfer a large number of blogs in a WordPress MU installation.

  3. Matthew says:

    How easy is it to change domain names, is it just the same, replacing within the MySQL database, but not the IP?

  4. albert says:

    I have a problem on $base in config file. I have installed WP on a subdirector like http://www.domnain.ca/blog , what should I put instead of ‘/BASE/”
    Thanks

    Albert

  5. Johan says:

    Matthew, the steps outlined here should be enough to do when you change domain names. I don’t think the newer versions of WordPress require additional changes.

  6. Johan says:

    albert, are you referring to problems that your having with the .htaccess file?

  7. Agata says:

    Hello
    I have done that is written in the post, but now I have not access in administrative area, because can not I do the login.
    why? 🙁 please help me.

  8. Johan says:

    Agata, did you forget your admin password?

  9. Loonie says:

    Hi,

    I didn’t transfer my wordpress µ installation but I changed my domain name. I did what you said in this post. I can login to my site and blogs backends, but it seems it cannot find my blogs ! In the frontend, as you can see, I get 404 errors when I try to see a blog, and in the backend, none of my posts, comments, themes and all don’t appear. They still are in my database and ftp, though. I even tried creating a new blog, but this blog gets a 404 error too.
    Do you have an idea of what’s going on and how to fix it ?
    Thanks !
    .-= Loonie´s last blog ..Hello world! =-.

Leave a Reply

Your email address will not be published. Required fields are marked *