I have a webserver in production. Its IP is 111.111.111.111 and it is referred to as ServerA. In addition to storing script files, the server also stores user uploaded files and has a database. The application uses wildcard subdomains where foo.example.com, bar.example.com, etc go to a common virtual host, and the server code responds as appropriate given the subdomain name. I have my domain registrar pointing to IP 111.111.111.111 and also set up to support wildcards.
I will need to change webservers to a new server with IP 222.222.222.222 which it is referred to as ServerB.
What steps should be taken to migrate the servers with minimum downtime?
Below is my initial thoughts. Please comment if incorrect or if I am missing steps.
- Post notice on ServerA that the system will be down for maintenance.
- Setup Apache on ServerB similar to the setup on ServerA and also add another virtual host on ServerB with ServerName 222.222.222.222, (more on this later).
- Set up Apache on ServerA to display a down for maintenance page instead of accessing the application script.
- Copy script files, uploaded user files, and the database from ServerA to ServerB.
- Change domain registrar to point to IP 222.222.222.222.
- Setup Apache on ServerA to redirect all requests to IP 222.222.222.222. How will this work with the subdomain requirements?
- Wait for domain name changes to propagate. Will I be down during this time?
- After ServerB is fully tested, cancel service plan for ServerA.