Dealing With Potential Problems During Implementation

After the first two articles about WordPress for the enterprise, Article 1 and Article 2, I am writing this third articles about some of the nuances of the process of converting an old home grown CMS based site to WordPress for the Enterprise. There are and always will be some hiccups along the way. So let’s get into what happened.

WordPress on Load Balanced Servers

Our company deployed WordPress on load balanced servers, so how did we do it. It was supposed to be pretty easy to do, and if your site is configured properly, basically all you do is:

1. MySQL On A Separate Server
Make sure the WordPress MySQL database is located preferably on a separate server, not localhost, or if you are not that sophisticated on one of the two boxes.

2. Firewall Rules
Make sure that there are no firewall rules in place that would hinder the servers accessing MySQL remotely. We had to have firewall rules allowing communications placed between the production servers and the database server.

3. Location of MySQL Server
Also, we made sure the MySQL server is located within the same data center. If your database server is in Houston and your application (WordPress) servers are in Boston, it will be as slow as molasses…

4. Pre-Loading MySQL
Instead of loading MySQL from the initialization process that WordPress automatically uses, we sync’d the QA MySQL with the production DB. This allows us to have an instant production server, and just be able to make an adjustment to the WordPress config files.

5. Third Level Domain Names
Hopefully you will have an SA to help you if you are using load balancing. Very specifically we set up a unique domain (third level TLD) for each production server. For instance if you are Danspetloversparadise.com, you would set up server1.danspetloversparadise.com and server2.danspetloversparadise.com, and test both servers individually. I will get to that in a moment. In addition, in our case, we had an existing production server, with the name of the final site on the production server. Sounds confusing, and if you have questions, just login to this site and ask them. So in this case, you would want to create a new.danspetloverspardise.com, in order to test out the site before going into production. Sounds like a lot of extra third level domain names and work, but that is what it takes to do it right in the enterprise environment.

6. Webserver (Apache) Configuration
So on both servers, you would need to configure one of the third level domains and new.danspetloversparadise.com. Turns out we had some major issues with our apache configuration, and we had to use the SAs to take a look at the Linux based apache config, httpd.conf. Now, I am assuming you are Unix based or Linux based, but this could be an issue for Windows users as well.

7. Server Testing and wp-config.php
Once the sites all showed up, we are ready to go through a series of tests using wp-config.php. Set both wp-config.php files on both server1 and server2 to point to the proper DB, Host, user and password. The conundrum of WordPress in the Load Balancer, is you have to set the database to one site name at a time to do the testing. So here is the sequence:

8. First Test server 1
This would be server1.danspetloversparadise.com as an example. This requires adjusting 2 options in the Database manually under wp_options, site_url and home options. I use phpmyadmin for this. If you have it and know it, use it. The reason I recommend switching this directly in MySQL is it is possible when you go to save the WordPress options in the WordPress settings area, it will reset and push you to the wrong site… So change the site_url and home options to server1.danspetloversparadise.com and then go to server1.danspetloversparadise.com and see if the site shows up. To finish off this test, login to wordpress, and using the Velvet Blues URL manager I recommend in Article 2, swap the QA url for server1.danspetloversparadise.com… And see if it works and you can get around the server1 site without a problem. If it works, time to test server 2.

9. Second Test server 2
Swap the site_url and home options in MySQL wp_options to server2.danspetloversparadise.com, then go and and using Velvet Blues URL manager swap server2.danspetloversparadise.com with server1.danspetloversparadise.com. Then test the site as server2.danspetloversparadise.com. If it works good, it is time to test the new.danspetloversparadise.com.

10. Load Balancer Test
Swap the site_url and home options in MySQL wp_options to new.danspetloversparadise.com, and then go and using Velvet Blues URL manager swap server2.danspetloversparadise.com with new.danspetloversparadise.com. Test the site as new.danspetloversparadise.com. You should now be ready to swap the site over.

11. Using Redirection, the program I mention in Article 2, to test out all the old links on Google, Bing and Yahoo before doing the swap. This will take a while and it is critical in not losing old urls that will get zapped in a site migration, if you have a previous none WordPress site.

Next article will cover post migration for WordPress Enterprise users.

One Comment

Leave a Reply