Transferring a website from a subdomain to domain


#1

I want to build a new Wordpress website in a test subdomain, then transfer it to the regular domain.

Example:

Old website - http://www.oldsite.com
Test website - http://www.test.oldsite.com

Do I just delete everything within http://www.oldsite.com and copy the contents of http://www.test.oldsite.com into http://www.oldsite.com ?

I would keep using the same MySQL databases that I use in the old site.

Please advise and please forgive my newbieness if this has already been answered elsewhere.

Mike


#2

Subdomains are folders in your home directory just like a regular domain, so a simple renaming will do the trick.

Since it’s WordPress, are you using the One-Click advanced install? This will add a couple extra steps.

  1. Build test.oldsite.com as you said you would.
  2. When done, rename oldsite.com to oldsite.com.old
  3. Rename test.oldsite.com to oldsite.com
  4. Create an empty test.oldsite.com folder (or just delete the subdomain via the panel if you’re not going to keep it)
  5. Go to the wp-admin for your site and change the URL Settings

-Scott


#3

Scott, will this preserve the one-clickness of the install? I know it’s not that hard to do Wordpress upgrades manually, but I don’t know of any extant mechanism for preserving a one-click install across domain/subdomain moves.

Use the [color=#CC0000]3DOM50[/color] promo code for 3 extra lifetime domains and $50 off
More Dreamhost coupons here!


#4

Yeah, the OP may need to remember to rename the directory back to it’s original One-Click name before applying any automatic updates from within panel as they become available, then rename it back again once it’s been updated.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

There is one extra twist if it’s a one-click, so mix this in:

After you rename oldsite.com to oldsite.com.old, make an empty oldsite.com folder and install a new WordPress One-Click. This is just to fool the system that there’s a WordPress at oldsite.com

So rename this new WordPress oldsite.com to something like oldsite.com.wp and then move test.oldsite.com to oldsite.com. 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.

-Scott


#6

Good advice Scott. For completeness, we should mention that one should make sure to update oldsite.com to the latest version of WordPress before making these changes. That way, it will match the version installed by the one-click installer in Scott’s extra step.

Use the [color=#CC0000]3DOM50[/color] promo code for 3 extra lifetime domains and $50 off
More Dreamhost coupons here!


#7

Thanks so much, guys. I appreciate it.

Here’s what I think you’re telling me. Please comment further if I have screwed it up. If it is correct, should I add it to the wiki?

I want to build a new Wordpress website in a test subdomain, then transfer it to the regular domain that already contains other subdomains and web-based applications.

Example:

Old website - http://www.oldsite.com
Test website - http://www.test.oldsite.com

  1. Using One-Click, install WordPress into http://www.test.oldsite.com.
  2. When done, rename oldsite.com to oldsite.com.old
  3. Make an empty oldsite.com folder and install a new WordPress One-Click. This is just to fool the system that there’s a WordPress at oldsite.com. 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 oldsite.com to something like oldsite.com.wp and then move test.oldsite.com to oldsite.com.
  5. Rename test.oldsite.com to oldsite.com
  6. Create an empty test.oldsite.com folder (or just delete the subdomain via the panel if you’re not going to keep it)
  7. Go to the wp-admin for your site and change the URL Settings

#8

That’s it. I expect that Step 7 will go off without a hitch, but if it turns out that the site is flakey due to a mismatched URL, you’d have to manually go into the database and update the site URLs. They’d be in the Options table.

-Scott


#9

Many thanks!