Replace existing site with site developed in a subdomain


I have been working on replacing an existing web site with a new WordPress site developed in a subdomain. I’m now ready to “throw the switch,” and I hope to avoid breaking anything. I found a thread from 2008 that seems to suggest a simple, practical method for accomplishing this objective:

Is the suggestion in this post still valid? Are there better ways to get to the same result? Are there traps for the unwary I need to be concerned with?

My case differs from the original 2008 post in that the existing web site in not a WordPress site, so it does not have MySQL databases that I can use. Does this fact require additional steps?


That approach still works well. You also need to change the url in the wordpress dashboard, and that should be done just before you rename the directories.

One more step would be to use phpMyAdmin to search and replace with in the database of the wordpress site you have been developing. Wordpress tends to build absolute rather than relative links in it’s database. The result is for example, if you upload a picture to the media folder and link to it in a post the link will be set to… in the databse, the search and replace is to update those links.

#3 is really good for that.


Thanks! Here’s what I did, and it seems to have worked.

Old website -
Test website -

  1. Using One-Click, install WordPress into

  2. Back up the site, just in case! When done, rename to (using WebFTP).

  3. Make an empty folder (using WebFTP) and install a new WordPress One-Click (using the web Panel). This is just to fool the system that there’s a WordPress at Now future WordPress one-click updates can be applied to the new location since you just replaced an existing One Click with a different one-click.

  4. Rename the new WordPress to something like (using webFTP).

  5. Replace with in the database of the wordpress site you have been developing. From the WordPress dashboard, install and activate the velvet blues update urls plug-in ( Look for its menu under “Settings” in the left-hand pane of the dashboard and enter the old and new URLs. Check all the boxes except the one for GUIDs.

  6. Change the url in the wordpress dashboard (Settings|General) to from the test website URL (e.g., to the desired web site URL (e.g.,

  7. Rename directory to directory (using WebFTP). Try logging in to the WordPress dashboard on

  8. Review your pages and update links to uploaded files as necessary (the velvet blues update urls did not do this for me).

  9. Create an empty folder (or just delete the subdomain via the web Panel if you’re not going to keep it).


I should note that manual changes to the wp-config file also were necessary.


/** MySQL hostname */
define(‘DB_HOST’, ‘’);


/** MySQL hostname */
define(‘DB_HOST’, ‘’);


Unless you deleted, or moved to a different account, you don’t have to change that. They’re all aliases of each other.


I did delete the subdomain because it was no longer necessary. I did not intentionally delete the test database. But somehow, the site stopped working (“Error establishing a database connection”). Changing the host name as indicated fixed that problem.

This has been my first experience trying to put up a website, and I am still never quite sure whether (or why) some seemingly small change will result in some colossal error.


Ah, okay, when you deleted the subdomain, the DNS entry (which is what redirected to went away :slight_smile: That’s what I meant when I called it an alias.

All these new website terms will become second nature to you, and one day you’ll be surprised that people don’t know them! It’s cool, how we learn, isn’t it?


Dear readers,

I am very happy I found this topic, because I have been trying to find answers to an almost identical question the last week. Please allow my to semi-hijack this tread and make it more informative to other members with some added questions (and hopefully answers).

My questions concern the change from CMS (Joomla to wordpress), while keeping the same URL. Unfortunately I have not created my new (temporary address) website in a sub domain, but rather on a test domain. so this is my first question:

1] Are the steps above also valid for moving between two unrelated URLs (say, from to

My next question concerns the use of the dreamhost webFTP. I used that since it came recommended, but probably I did not do it right. In step 2 and 3 I need to rename the relevant folders (move to, then create a new clean folder “”, and one-click-install WP in the folder. When I tried that I received an error saying “Joomla! has already been installed at”. I got around this by removing the joomla installation in via the user panel.

2] Is there a better way of doing this? And why did I receive the error when following the steps described above?

When following step 6 (changing the URL in the WP dashbord of the old site (, I changed both fields (the wordpress address and the site address). This resulted in a then dysfunctional old website. In the end what I did was first following step 7 (renaming the old directory ( to the new directory ( Afterward I edited the wp-config file by adding the following lines:


3] Did I mess up step 6? Should I only have changed wp OR site address? And is the hard coding both addresses via wp-config going to bite me in the ass later on?

I hope you can help me, I look forward to a reply. Thank you!


Getting a nights sleep made me come up with one more question, which I hope is trivial.

I am also hosting a blog at, which is managed via a sub domain (e.g. different WP install). To move this to the new site, can I (using ftp) simply copy/paste the complete /blog/ sub directory to (and do I first need to create that directory via the dreamhost control panel) before moving the site as described above?

I hope these questions are not very trivial. I did search the forums here for answers but probably are searching using the wrong keywords. Thanks you for your (any) answers.


I have moved my question to it’s own thread since that might make it more relevant to other people searching for the same answer.

You can find it here.