Moving a large web application from a dedicated host running PHP 5.5 to Amazon AWS EC2 with RHEL and PHP 7.1.2 presented much less in the way of challenges than I had expected. Maybe I’m a pessimist but I expected it to be a long drawn out affair.
As with any software change, we created a branch from our master source in Git, and worked on this. We would merge that back into master once the AWS EC2 instance was finally in production.
PHP had to be configured, which is expected as we had installed PHP 7.1.2 and not yet touched its configuration. Having the old server as an example of what we needed made it very easy.
The application itself needed reconfiguration, as is normal when you move to new host. The database credentials needed to point to our database instance at AWS RDS, and other server specific changes like file locations needed to be made.
One issue I had was testing the application. We had to leave the current domain pointing to the old hosting as it was still in active use. How then to test the new server, while making sure that requests from it went back to the old server, without being noticed. If this happened, it wouldn’t be a complete test.
I added an entry to the hosts file (normally /etc/hosts) on both the EC2 hosting and my test client (my MAC). If ever there was a stray link to the old domain, it would always be directed to the the EC2 host.
Obviously these host file changes were removed when the new host was in production.
There were a number of coding issued to be resolved, mostly to do with functions that had long been deprecated, but now finally removed (like split()). Beyond that a few file permission issues, but they are normal.
Before going live I had to transfer newly created files from the old web server. I used rsync as this is the most reliable way to ensure all new and amended files have been transferred. And it is very quick and easy to use.
Form a user’s point of view the new configuration seems about 20% faster, but we feel comfortable that we can increase the EC2 instance to a more powerful option should this ever be needed.