Moving/changing one subdomain to something else


#1

Basically, I want to create a beta.example.com and then switch it over to example.com (while also moving example.com to old.example.com).

One approach would be to move all the files over, but this seems like it would be tedious (correct me if there’s an easy way to do it within DreamHost’s system).

My preferred method is to adjust the DNS so that content doesn’t move anywhere and the domains just start pointing to the right places. I’ve done a bit of searching but have not come up with a process for doing this, and the DreamHost control panel doesn’t make it obvious that I can do it there.

Any ideas? Thanks!


#2

Once you have everything set, you can just rename your domain folders:
Rename example.com to old.example.com, then beta.example.com to example.com
That’s all it takes to start serving up the new content. Just be sure to update any references to http://beta.example.com or /home/USER/beta.example.com in scripts, links, and configuration files.

-Scott


#3

Thanks Scott.

A followup question for you: Do you mean that they should be changed via FTP, or within the Control Panel under ‘Domains -> Example.com -> Edit’ ?


#4

I change mine via FTP. I don’t think the “Edit” option will rename the directory, but it will let you point it to a different directory, which will just confuse things if you’re serving example.com from beta.example.com.

Go for the FTP rename.

-Scott


#5

I’ll give this a shot!


#6

Just to be certain, this is my interpretation of what you do:

  1. You set up all the URLs you need.

  2. When you need to change them around, you just do renames on the domain folders (via FTP) and loading that URL will immediately start to serve up new content.


#7

A well-organized site doesn’t use full domain URLs, so there shouldn’t be much changing required. A dynamic site often has a config file with the base URL.

Your #2 is correct, as the change will be immediate as long as your browser’s cache is refreshed.
http://wiki.dreamhost.com/Clear_cache

-Scott