Transferring WordPress MU to Another Server
Posted by Johan Cyprich on 05 Jan 2008 | Tagged as: How To
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.
| Related posts: | |
|
|
Share this post:
Follow Me:
Did you find this post interesting and useful? You can keep up to date on this blog by subscribing to my RSS feed, or you can have new posts sent to you by e-mail. You can also follow me on Twitter.
9 Comments »
Tweet This Post!
















on 21 Sep 2008 at 7:23 am 1.Martin said …
Hi Johan,
have you found or written such a script?
Greets Martin
on 24 Sep 2008 at 11:00 am 2.Johan Cyprich said …
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.
on 17 Jan 2009 at 3:38 am 3.Matthew said …
How easy is it to change domain names, is it just the same, replacing within the MySQL database, but not the IP?
on 02 Feb 2009 at 12:59 am 4.albert said …
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
on 06 Feb 2009 at 12:15 pm 5.Johan Cyprich said …
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.
on 06 Feb 2009 at 12:16 pm 6.Johan Cyprich said …
albert, are you referring to problems that your having with the .htaccess file?
on 21 Apr 2009 at 2:37 pm 7.Agata said …
Hello
please help me.
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?
on 23 Apr 2009 at 1:14 am 8.Johan Cyprich said …
Agata, did you forget your admin password?
on 14 Nov 2009 at 1:35 pm 9.Loonie said …
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!