Make Sub-Domain become the Primary Domain

We will be officially going live with this site on June 3

http://dev.hinduismtoday.com

and retiring the current live site:

http://www.hinduismtoday.com

Now, the trick for us will be: is there some really simple, slick and easy way to swap these two:

/home/htoday/

with

/home/htoday/domains/dev.hinduismtoday.com/

I’m not a super unix nerd, I’m guessing this could be really simple, so this is just a guess and I wanted you pros to comment:

  1. mv /home/htoday/* /home/domains/old.hinduismtoday.com

  2. mv /home/domains/dev.hinduismtoday/* /home/htoday/*

  3. manually rename the folder "old.hinduismtoday.com" to "dev.hinduismtoday.com"

(that will be the only way we can still access the old content, because we used up all 10 of our licenses for virtual domains.

could it be that easy?

Well, ideally, you guys would be checking your website code into a revision control system like Subversion or Git or the like, and you could just instantly pull any version or branch of your code into any directory you like :slight_smile:

Barring that –

This command you mentioned is likely to be bad:

1) mv /home/htoday/* /home/domains/old.hinduismtoday.com

Don’t do that :slight_smile:

You’re likely to move a lot of things you don’t intend on moving (including the “domains” directory, and any user home directories, breaking email for all of them).

Is everything you’re modifying for the website in the public_html directory?

You could always just move public_html around rather than it’s entire parent directory.

So something like:

  1. Make full backups of your entire server! But this step is unnecessary, because you’re already doing all that, right? :slight_smile:

  2. mv /home/htoday/public_html /home/htoday/public_html.old

  3. mv /home/htoday/domains/dev.hinduismtoday/public_html /home/htoday/

  4. mv /home/htoday/public_html.old /home/htoday/domains/dev.hinduismtoday/public_html

  5. Restart Apache when you’re done

I think the above will do the trick, but it never hurts to test this stuff out on a dev system, or perhaps a VMware instance running on your desktop :slight_smile:

And again, if you don’t have full and recent backups, you’re asking for trouble :wink:

Good luck with the new site!
-Eric