Posted at 

October 2, 2018

 | 
By 

Grace Ouendo

 | 
In 

We have been working with WordPress and WooCommerce for a few years now. First we started with creating WordPress websites, and WooCommerce stores. Then we graduated to developing plugins and themes, which exposed us to another level entirely.

We found ourselves dealing with issues such as product marketing, customer support, coding standards, code reviews, product team management and so much more. But that’s what makes entrepreneurship so exciting, right? The latest issue we tackled is how to merge WordPress databases without loss on either side.

What inspired us to develop a wordpress site merging plugin?

Two years ago, a client hired us to develop a custom version of our product customizer plugin for a hair business. She wanted to be able to allow her customers to get product recommendations based on their hair profiles. We used WordPress, WooCommerce and our Visual Product Customizer as a base for her customization request.

We built the entire system successfully and we were using tags on products. The tags assignations were stored in the database. Each customer profile was also stored in the database and our product configurator was simply matching both to offer the customer the specific set of products recommended for his profile.

Since it was a startup, we setup 2 environments: a production website publicly accessible by her customers, and a staging one which we used to develop and test new features. We were pushing changes to the live site every 2 or 3 days depending on the complexity of the tasks.

The headaches experienced while merging two WordPress site versions

Coding and testing were the easy parts of the whole process. The painful part was when we needed to push the changes we made because that affected the live data on the production end.

We started using WP Migrate DB pro first and then noticed that while we worked on the staging website, the production website was still getting new orders and comments on products. So overwriting one of the site database with the other was not an option anymore.

We decided to re-do everything manually and spend time checking the whole process multiple times. During a particular occasion, one of the developers was so tired that he forgot to reapply some of the changes to the live website.

This in return created a bug that affected the checkout! Needless to say the client was really upset and who could blame her?

We started looking for a better way to tackle this issue

We searched for plugins that were able to merge 2 WordPress sites databases and found Mergebot. It was great but when there was a lot of data to merge, it slowed down.

We also needed to remember to record our work to apply it live which was a bit a bummer. That’s when we started thinking: how can we build the perfect tool for this challenge? One that would merge databases without any loss in either WordPress site?

The solution to the database merge problem: WordPress Data Merge

It was easy to imagine that a lot of developers would be going through this same problem and would be looking out for a plugin that would save them the stress of doing everything manually.

WordPress is the most popular Content Management System globally, and there were thousands of developers that pushed out plugins every day – surely they would have to merge databases at one point or another.

To help ourselves and to help others became the drive to the creation of WP Data Merge.

A WordPress website is made of two things: a mySQL database and the files (themes, plugins, and medias). A perfect way of syncing two wordpress websites would be to compare the two websites databases and files and merge the differences.

  • What if the user does not want to merge all the changes he made in the staging environment but only some of them?

We thought about it long and hard. Our solution would be to compare the two databases, display the differences to the user and let him select what changes he wants to push live.

  • How are we able to compare two mysql databases and quickly detect the differences?

We used a technology named K-PAX, developed by one of our long time friends. K-PAX is simply a revolution by the way it understands and reconciles data.

In a few words (that are not enough to explain everything it’s able to do) that technology is able to analyze, organize or reconcile any kind of structured data such as txt, csv and database systems. Using K-PAX, WP Data Merge is able to compare wordpress databases and detect their differences to ease the merging process.

  • How will we handle the files comparison?

For now we focused only on the merging process of the WordPress databases. Once that part is fully stable and validated by customers, we’ll take care of the disk files (including media files) comparison process.

  • How will we handle the merging of the selected changes in the different databases?

Once the changes to merge are selected by the user, we’ll simply generate SQL requests based on what actions to execute in each database.

  • What about the security?

We understand that security is crucial to the exchange between the sites. That’s why we installed a system of keys that the two websites will use to secure all their communication via the REST API included in each WordPress installation.

For more infomation, visit https://wpdatamerge.com/  

Your questions and comments are all welcome!

Leave a comment

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