Sunday, August 31, 2008

Migrating a domain with related Google Apps and hosting files to a new service

A year ago I wrote about adding adding Google Apps services to our existing domain. Back then Lunarpages managed most of my domains and sites, but I fired them recently.

Now I'm migrating my domains and hosted files to DreamHost, including I was worried about that one. How do you migrate Google Apps?

Briefly, if you know the sequence to follow, the answer is -- very easily.

I've not only migrated, I've also added a new subdomain, to hold files (something Google doesn't really do) and I've restored the subdomain for our blogger blog (Lunarpages broke that).

The hardest part for me was understanding how things work. Once I knew that, I knew what to avoid and what to do. Understanding took a couple of days and help from DreamHost tech support; execution took minutes. (See migrating my domains and hosted files for the steps involved in switching the domain itself.)

To understand how the magic happens you have to know what 3 entities do:

  1. The registrar (Tucows, will be DreamHost): maintains the relationship between the domain names we type ( and the IP address of the name server you are using.
  2. The nameserver owner (DreamHost): routes all kinds of requests for web pages and services
  3. The web site provider (also DreamHost): provides file services, http and ftp, etc
  4. Google Apps for a domain: provides google apps (available only to person who can provide domain ownership)
Next you have to know two key things:
  1. You can do whatever you want to the DreamHost DNS settings, but until you tell your registrar to use the nameserver nothing will happen. So you can get everything ready at DreamHost, the turn it on by switching nameservers at your registrar. You can switch back to Lunarpages just as easily. It doesn't matter whether DreamHost or Tucows or Network Solutions or eNom or GoDaddy is the registrar.
  2. For a request for "" to work you need to do two things:
    a. set up a rule in your nameserver provider's DNS to route all traffic for to This is done by a CNAME (below)
    b. in your Google Apps you need to setup a custom name that exactly matches the name you created in the CNAME.
Ok, so that's complicated. Let's walk through an actual transaction.

When I enter "" in my browser, the Internet's DNS system first "asks" where to route the request. The registrar for knows to send all domain traffic DreamHost nameservers - because I told it to use those nameservers.

So the requests go to the DreamHost nameserver. As we see in this picture of DreamHost's nameserver the subdomain request is then routed through a CNAME to Google (

So the request for effectively goes to Google. On the other hand, for example, would have to be handled by DreamHost.

When Google gets this transaction it sees it's a request for "". It matches this request against the custom URL I assigned my Google Apps calendar through my Google Apps Dashboard, and it renders the correct calendar.

Ok, if you understand all of the above then you're ready to understand how I migrated, and its related Google Apps services, from Lunarpages to DreamHost. You may also see why Google Apps are so loosely related -- they are really only bound together at the DNS level.

In this case everything was already setup on the Google Apps side, including using Google's now obsolete Page Creator to manage our web pages.

I just had to setup the DNS at DH so it had the right CNAME settings to direct traffic and handle mail. These are totally generic, the traffic gets routed to the right Google Apps because of the matching domain names, not because of anything special in this table.

  1. I used DreamHost's "fully host domain at Google Apps" first. That created almost all the CNAME and MX (mail exchange, see DNS record types) settings in the above image.
  2. I manually added the CNAME entry of "". I'd made a corresponding change in a Blogger blog, publishing it to "".
  3. I changed the nameserver settings at my registrar (Tucows at the moment) to the, etc settings.
That was it. Everything worked as before, except that Lunarpages had broken things and couldn't fix them. So now it really worked.

I wanted one more thing though. I wanted a place to store files -- something Google Apps does very poorly.

That was easy too. At DreamHost I created a subdomain of

I configured that subdomain so anyone entering "" would go to "" (a DH configuration setting).

So now I had my files section -- with FTP services too.
It took a while to understand this, and a bit of time to write it up, but not time at all to do it. DreamHost tech support was very helpful, though they did have to correct themselves a couple of times.

No comments: