Flipping a Website

**MMR Comment: Originally published on Facebook in my Notes: http://www.facebook.com/melissa.raulston?sk=notes#!/note.php?note_id=426030263110

===============

I wrote this note for Andre Collares and Jeff Budnick, webmasters at the Children’s Campaign this semester, as a recap of how we flipped them from the old website to the new. On re-reading, I think it is a good note to archive as it contains useful information for any of my aspiring young webmasters. Here you go:

1. Look up ALL  DNS records for the site (including any alternate names pointing at it…) and make sure they are correct. ESPECIALLY the nameservers. Not just the name of the nameserver but the IP each one resolves to.  We had an issue this evening bc ns1 pointed at a nameserver that I took down two weeks ago. Whoopsie on my part bc I did not realize I had pointed ns1 to that server and did not fix it when I took the server down. This sort of thing happens all the time. You check the DNS before you do anything and fix any issues you discover BEFORE YOU DO ANYTHING ELSE. Fixing after is a giant pain in the ass. Do this step first and never skip it. You will thank me later for instilling this habit in you. We used DNSTools.com to do the lookup tonite. There are many other ways you can look up DNS records. Explore your  options, pick a tool you like and USE IT. OFTEN!

== I have my TTL turned down to 15 minutes already but if you are dealing with a record somewhere else, it may be considerably higher. TTL affects how long a DNS server is supposed to hold the record before dumping it. They sort of generally respect that but not always as we discussed tonite. For the servers that do respect TTL, you want that setting down LOW before you do transfer of any sort so MOST servers pick it up in 15 minutes. You can and should turn the TTL back up to a much higher value like 6 hours after you do the flip.  Mark this as a point of further discussion, too much for an email.

== As you saw tonite, it was not enough to change the A record for ns1 to point at the correct IP (my server…) You also have to update the IP at the domain registrar so this new information writes to the root servers. We went to GD and accessed the records for IAmForKids.net because remember – the nameservers are set up on the .net name even though the site runs on .org. We changed the ip of ns1. Iamforkids.net FROM 97.74.66.31 TO 208.75.XXX.XXX. It is IMPERATIVE that you update the record at the registrar.   Mark this as a point of further discussion, too much for an email.

== You make changes and keep checking it against DNSStuff until correct. They look up at the root. If they do not report correct results, something you did is wrong.  I assure you they don’t make mistakes. You MUST validate that DNS is correct with a trustworthy tool before you continue to the next step.

Once the underlying records were correct, we set up an A record for old.iamforkids.org We pointed it at the old site IP so you guys have a way to get back to it if you need it.

Went to IIS on OLD server and added a Host Header for old.iamforkids.org

Checked to make sure old.iamforkids.org loaded. If you are starting to get the glimmer of do and check, do and check, do and check. Yes. Do and check at every single tiny step. You will thank me later.

Logged into wp-admin and changed the url from wordpress.iamforkids.org to www.iamforkids.org. Blog broke, that’s ok. We fix in a minute.

Logged into NEW server.  Added host headers for www.iamforkids.org and iamforkids.org and removed  wordpress.iamforkids.org. NOTE: I did not remove the host headers on the OLD site for www.iamforkids.org and iamforkids.org. That was deliberate. Think about  our experience tonite and see if you can figure out why I did that. We will remove them in a few days but why didn’t I do it tonite?

ALWAYS add the host headers before changing the A record. Ask me why.

Last step is to pull the trigger with the A record. Because I use a cname for www I only have to change one record, the A. If confused about this, ask me so I can show you. We changed the A record from the OLD server to the New.

The we waited and checked. We used ipconfig /flushdns to dump our local dns cache then we pinged to see which IP were getting. This is how we know when the change has propagated -we start getting a response from the new ip when we ping.

We clicked around and found broken stuff. Yes Andre, you do have to stay up late and fix that stuff. Welcome to the life. If you want to be webmaster, embrace it.  You will  do a lot of work late, late in the evening.

OK. We will have some fill in the blank time to go over all this again but I wanted to give you a mini writeup while it was fresh in my mind.