Changing the domain in WordPress Multi Site.

If you have to or want to change the domain of your WordPress MU site. The domain name is actually stored in different places in the database, as well as online in wp-config.php. Every instance of these will need to be changed.

Before you do anything create a  backup. Go to phpMyAdmin, select your database, and choose Export. Save it to your computer. We’ll be making a copy of this and working on the copy. This way, if anything goes wrong, we still have our backup.

The database information – table structure, content, everything really – is stored in a file with the extension .sql. This can be read and edited in a simple text editor.

Simple do a find and replace on currentdomain.com to newdomain.com. Save your copy.

Simple do a find and replace on currentdomain.com to newdomain.com. Save your copy.

Method #1:
– on the live site, verify you have that backup, then drop all the tables in the database.
– import your edited sql file with the new domain name in it. (phpMyAdmin -> Import tab.)
– edit wp-config.php with the new domain name
– change the DNS records for the domain so the new domain points to the right spot on your server if you haven’t done it already.

Method #2:
– create an entirely new database. Use an existing db user & password, or create a new one – your choice, as long as they have ALL privileges on this database.
– import your edited sql file with the new domain name in it. (phpMyAdmin -> Import tab.)
– edit wp-config.php with the new domain name AND the new database name, plus the new db user & pass if you did this.

Related Posts:

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>