A server failure often comes unexpected. DOS attacks, network connectivity problems, hard disk crashes, etc. can lead to websites being inaccessible, causing business downtime.
In WordPress hosting, customers expect high uptime for their sites. We help VPS/server owners and cloud hosting providers provide the guaranteed uptime for websites by setting up Wordpress mirroring.
Mirroring is the process of creating and maintaining identical websites, ideally in two different servers, to ensure that the business is not affected even in case of server failures.
At Bobcares, we configure WordPress mirror sites as a part of our 24/7 Proactive Server Management services. It involves 2 activities:
24/7 server monitoring
Our experts monitor critical server metrics such as disk usage and server load round the clock. When we detect an anomaly, like high CPU load, we immediately login to the server, kill abusive processes, and prevent a server crash.
Setting up and maintaining WordPress mirrors
Duplicate or mirror WordPress sites are created and maintained for the customers. When a server crash or network issue occurs, our expert team immediately initiates the fail-over process to prevent website downtime.
[ You don’t have to lose your sleep to keep your customers happy. Our Hosting Support Specialists cover your servers and support your customers 24/7 at just $9.99/hour. ]
How to setup WordPress mirror sites
Mirroring WordPress sites involves keeping two WordPress blogs in two different servers, in sync with each other. The data that is stored in the WordPress database and files should be maintained up-to-date among them.
With this mirroring setup, when a post in the blog is updated, the changes would reflect in both the sites. But, there are a few key points to keep in mind before setting up the mirror.
a. WordPress sites store data in database and files. Both these data should be copied over for successful mirroring.
b. The website URL plays a very important role, and it has to be updated correctly in the database entries, for the website to work.
There are two types of mirroring – one-way and two-way. In former, a backup website is setup and the WordPress site contents are copied over from the original site to backup site.
In two-way mirroring, there are simultaneous updates in both the websites, to keep them in sync. We accomplish this using the same database in both sites or using MySQL replication, along with a fail-over webserver.
[ Running a hosting business doesn’t have to be hard, or costly. Get world class Hosting Support Specialists at $9.99/hour (bulk discounts available) ]
Here we’ll discuss a step-by-step process to mirror the WordPress websites.
1. Create a mirror website
To create mirror site, we usually choose a server from a nearby network range to reduce bandwidth costs. For high level business continuity setup, we opt for servers from a distant geographical location.
This server is then configured with the same Apache/PHP/MySQL configuration settings as the original server. In this server, we add the new website to host the WordPress mirror.
The new website is usually created with the same name as the original one, for ensuring business uptime. We install WordPress in it, create a database and user and make sure that the DB user has access to it.
If the website name is identical for both the sites, the mirror site can be made active by switching the DNS to the new server IP, when the original site goes down or needs maintenance.
To facilitate easy switching of website and to minimize website downtime, we maintain an external DNS server and adjust the TTL settings for the domain.
2. Copy over the contents from original site to new site
After setting up the website, the next step is to copy over the contents from one site to the other. To copy, there are two ways – 1. Using the ‘export/import’ utility in WordPress 2. Manual transfer.
In WordPress Admin Dashboard of the original site, use the ‘Tools -> Export’ utility to export the WordPress site contents to an XML file.
The exported XML file can be saved in a safe location and then uploaded to the mirror site using the ‘Tools -> Import’ utility in the WordPress Admin Dashboard of the new site.
The Importer plugin for WordPress need to be installed first, and then the XML file can be imported to the mirror site. Now the WordPress contents would be restored in the mirror site.
For large websites or with memory limit restrictions, the WordPress ‘export/import’ utility may not work well. In such instances, we perform a manual copy.
To perform a manual copy of WordPress mirror, first download the website files and export the WordPress database of the original website. Exporting the database can be done via MySQL or using PhpMyAdmin utility:
Browse the database in the PhpMyAdmin and click on the ‘Export’ tab to download the database. The backup will be downloaded in an SQL file format. We store this backup in a safe location outside the website server.
We then copy over the entire files in the WordPress folder, including the hidden files such as ‘.htaccess’, from the first server to the new one, using tools such as ‘rsync’.
Then, we import the database SQL file via MySQL or using PhpMyAdmin in the new server. Before importing, we ensure that there is adequate PHP upload limit set in the new site, or else the import can fail.
Manually doing the sync of WordPress mirror sites is not feasible when there are multiple websites and a huge chunk of data involved, as it can waste a lot of time and effort.
In such scenarios, to reduce the overhead involved in copying over, we automate the entire process using custom daily cron jobs, which syncs the WordPress files and databases via backend, during off-peak hours.
3. Test the WordPress mirror site
After copying over the contents from original site to new site, we check the URLs to confirm that WordPress mirror is working fine. The Permalinks and SiteURL settings are updated for proper functioning of mirror site.
Ownership and permissions of WordPress files and database are correctly updated in the new server. We also check for broken links, if any, and fix them before the new site is made live.
If the WordPress mirror site has a different URL and database name compared to the original site, as few more updates are done, such as the SiteURL and the database name.
In the WordPress database file that was exported, we replace the URL for the website with the new site name. Also, WordPress config file is updated with the new site’s database name, user and password and SiteURL.
[ Use your time to build your business. We’ll take care of your customers. Hire Our Hosting Support Specialists at $9.99/hr. ]
A few points to note..
- DNS updates and website redirects should be done proactively to minimize the time taken for the new website to load.
- SQL file updates should be done with utmost caution or else the website can end up broken.
- The ‘Export/Import’ tool would only transfer the WordPress contents and not the plugins and themes. They have to be manually reinstalled and configured in the new site.
- For load balancing a WordPress website, we make use of this mirroring technique, so that the webserver load is shared equally among the two sites, to avoid a downtime.
Bobcares helps online businesses of all sizes achieve world-class security and uptime, using tried and tested solutions. If you’d like to know how to make your servers more available, we’d be happy to talk to you.
0 Comments