How to Move WPMU to a New Domain – The Simplest Guide Ever

This is the quick reference you need when the unfortunate task of migrating a WPMU installation to a new domain falls to you. These instructions should be sufficient for you to move your WPMU install, whether it’s within the same hosting account or you have to put it on a new server. Don’t freak out. We’re going to make this relatively painless for you. There are times when your new host will offer to move all of your data from your old host to the new one but this usually only involves moving the files and databases. There are a couple more steps involved but they won’t be difficult for you because you have this handy guide. Let’s get started!

1. Back everything up before you start this process – files, databases, etc.

You may be in a hurry, but you’re not brain dead, so I know that we can count on you to back up your data and not litter the WordPress forums with problems that could have been averted by making a simple backup.

2. Copy all of the files in your WPMU directory and move them to your new server or new directory via FTP.

If you don’t know how to use FTP, then crack a beer and start googling, my friend. ;)

3. Log in to phpMyAdmin and export your database as a .sql file.

The export tab should be clearly marked. You can find step-by-step help here.

4. Open the exported .sql file in a plain text editor. Perform a search and replace function for the domains.

Search for your old domain and replace it with new one. Save.

5. Create a new mysql database wherever you are hosting the new installation and a new user with all privileges.

(If this step isn’t something you can do in your sleep, then you should probably hire someone to move your site for you.)

6. Import your newly saved .sql file into the database you just created.

7. Open up your wpconfig.php file and input the values for your newly created database/user/password.

define(‘DB_NAME’, ‘wpmu’); // The name of the database
define(‘DB_USER’, ‘wpmu’); // Your MySQL username
define(‘DB_PASSWORD’, ‘hackme123′); // …and password

Save and upload.

Congratulations! You should be operational on your new domain now!

Tips and Hints:

  • Make sure your FTP client copies over the hidden files as well so that you don’t lose your .htaccess file and waste two hours wondering why you’re getting 404 errors.
  • The .sql file can be huge. If your OS crashes while editing it, you may want to shut down most of your applications before embarking on this process, especially resource hogs such as Photoshop and Firefox.
  • If you have wildcard DNS enabled on your old domain for subdomain blogs make sure you’ve got it enabled at your new host if you’re changing hosting environments.
  • If you want any of your inbound links to your old domain to work, you’ll need to do a little bit of redirection magic. Don’t forget about those.
  • For those who dig command line instructions instead of using a GUI, I recommend this post. This can be really helpful if your phpmyadmin times out when you’re doing the import.

Comments (4)

  1. Nice guide, but you can’t just do a search and replace on the SQL output from a DB backup and expect it to work properly, sadly. What will happen is that the serialized PHP arrays that are used in many places in WP, badly, if the domain appears in them and the length changes in any way. Widgets will break, settings will disappear… it’s not pretty.

    Your method is fine for a simple install, with simple blogs, but otherwise flakey.

    Thankfully, and without doing too much of my own trumpet blowing, I hope, I recently documented an alternative way to migrate WPMU and pals over at http://www.interconnectit.com/719/migrating-a-wordpresswpmubuddypress-website/ and we’ve released a search and replace utility, which works at least on the sites we’ve tested it on, over at http://spectacu.la/search-and-replace-for-wordpress-databases/

    I hope you don’t mind those links in there, and that you find them useful.

  2. Thank you for the very informative guide.

    We would like to add www to our existing site http://ancestry24.com that’s been up and running for a while now.

    We are running: WPMU 2.8.6 / Buddypress 1.1.3

    I’ve commented out the www stripping code in wpmu-settings.php, added a 301 redirect in .htaccess to add www. Search and replaced all the instances of http://ancestry24.com to http://www.ancestry24.com and edited wp-config.php to use http://www.ancestry24.com, but all fails…

    Any suggestions would be appreciated.

Participate