Moving wordpress from one domain to another (both hosted at dreamhost)



Hi there,

I own two domains hosted at dreamhost. One is (A) and the other one is (B). Initially B was hosting my wordpress blog which used a MySQL DB (hostname:, DBs: pheromonekid_com and pheromonekid_com_1).

I moved my wordpress blog simply by moving the files from B to A without bothering too much about MySQL DB and making B redirecting to A. This works.

However, right now I have been requested to sell the domain B and I am worried that if I’ll do that, MySQL hostname will be wiped out as well and A will cease to work. I created a new hostname ( and tried to recreate the DBs there, but when I try to create pheromonekid_com and pheromonekid_com_1 I get a message telling me that these DBs already exist.

This leads me to think that and are just interchangeable and if I’ll delete domain B everything will go on working, but I wanted to double check with you guys before doing anything like that. In case I am mistaken, what should I do to guarantee continuity with my site (I already exported the DBs so it shouldn’t be that complicated to recreate them)?[hr]
Mmm, on a second thought, I think that I’ll have to move the DB from to Any idea how to do it?


[quote=“ethanv, post:1, topic:54466”]

This leads me to think that and are just interchangeable and if I’ll delete domain B everything will go on working, [/quote]

Yes & are interchangable HOWEVER - wordpress looks for
can’t remember which file it’s in, but it’s one of the set up files in wordpress… and you just need to change that…


OK, I figured that out.

Following is a how to migrate wordpress from one domain to another.

Initially wordpress was loaded on (olddomain from now on). Thus I created ( from now on). Both and were hosted by dreamhost.

[] login on
] Under Goodies->MySQL Databases click on Add New Hostname
[*] Choose a name for the new host and select your new domain (like

[] ssh to dreamhost server using your username and pwd (or alternatively you can use the WebFTP on your dreamhost panel)
] copied all files from ~/[your_blog_directory] to ~/[your_blog_directory] (in case you don’t have a blog directory it’s fine as well…)
[] edited the file sitemap.xml and replaced all the occurrences of ‘’ with ‘’ (remember to make a backup copy of the file first)
] edited the file ~/[your_blog_directory]/wp_config.php (remember to make a backup copy of the file first) and replaced the field :



[] go back to Goodies->MySql Databases
] under Hostname you should see If you don’t, don’t panic. Usually it takes a bit before propagating the changes. Click on phpMyAdmin near the hostname
[] insert your username and password (they are enlisted in the MySql Databases page if you don’t know/remember them)
] once logged in phpMyAdmin click on the name of your DB (it’s on the left)
[] click on SQL on the tab on the right
] Write the following commands in the text area:

UPDATE wp_s1uogr_options SET `option_value` = REPLACE(`option_value`, '', '') WHERE `option_value` LIKE CONCAT( "%", '', "%" );
UPDATE wp_s1uogr_posts SET `guid` = REPLACE(`guid`, '', '');
UPDATE wp_s1uogr_posts SET `post_content` = REPLACE(`post_content`, '', '');
UPDATE wp_s1uogr_postmeta SET `meta_value` = REPLACE(`meta_value`, '', ''o);

[*] press ‘Go’
That should be it.

[B]NOTES:[/B] I experienced some weirdness with phpMyAdmin and Chrome. Because of a bug with session management, it is pretty impossible to log out phpMyAdmin, so I had to do all this stuff with Firefox or Safari. Also, for extra security you might want to export the DB and create a copy with a different name and user. In that case you should replace the field DB and USERNAME in wp_config.php