Thursday, 22 March 2007

Mass-migrating websites - DNS changes tracking

First shot - migrate several hundreds of websites from one server to another... Copying is a simple task... creating config files is simple task... changing DNS records is boring (and simple)... but keeping track of which DNS domains were properly propagated and which not is a stupid and annoying job... Perl to the rescue!
This is based on several assumptions:
  • we use apache2-like way of configuration - all virtual hosts in separate files
  • each file has one ServerName statement and possibly ServerAlias with unlimited amount of names following it
  • each file has the same name as domain - either with or without 'www' at the beginning (so for sure it has at least one dot in the name)
  • we are only interested in the DNS records pointing to the right IP