Bobcares

WordPress mirror – Your insurance against server failures

by | Jan 27, 2017

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.

 

wordpress mirror export

Export WordPress site

 

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.

 

wordpress mirror import

WordPress import utility

 

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:

 

wordpress mirror export database

Export WordPress database

 

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.

 

wordpress mirror import

Import WordPress database

 

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..

  1. DNS updates and website redirects should be done proactively to minimize the time taken for the new website to load.
  2. SQL file updates should be done with utmost caution or else the website can end up broken.
  3. 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.
  4. 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.

 

STOP SPENDING TIME ON SUPPORT!

Do you spend all day answering technical support queries?

Wish you had more time to focus on your business? Let us help you.

We free up your time by taking care of your customers and servers. Our engineers monitor your servers 24/7, and support your customers over help desk, live chat and phone.

HIRE SUPPORT SPECIALISTS AT $9.99/HR

Bobcares provides Outsourced Web Hosting Support and Outsourced Server Management for online businesses. Our services include 24/7 server support, help desk support, live chat support and phone support.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF