Moving/changing one subdomain to something else

Moving/changing one subdomain to something else

Posted by: dlm
Posted on: 2009-10-28 05:24:00

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!

Re: Moving/changing one subdomain to something els

Posted by: sdayman
Posted on: 2009-10-28 06:36:00

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

Re: Moving/changing one subdomain to something els

Posted by: dlm
Posted on: 2009-10-28 13:23:00

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' ?

Re: Moving/changing one subdomain to something els

Posted by: sdayman
Posted on: 2009-10-28 15:42:00

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

Re: Moving/changing one subdomain to something els

Posted by: dlm
Posted on: 2009-10-28 15:43:00

I'll give this a shot!

Re: Moving/changing one subdomain to something els

Posted by: dlm
Posted on: 2009-10-29 13:48:00

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.





Re: Moving/changing one subdomain to something els

Posted by: sdayman
Posted on: 2009-10-29 19:00:00

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

Tags: preferred methodsubdomaincontrol panel