Been working locally on a WooCommerce site. Changed permalinks, changed the theme, using local theme supported FAQ instead of plugin based FAQ on live. Also dropped a Text based widget in favor of a menu widget and changed the slider. And some other stuff. So I changed a lot. In the meanwhile there have been orders as well as AWeber newsletter subscriptions. So how do I deal with keeping the local WooCommerce site in synch with live site?
Options to Keep Local and Production in Synch
Mind you, synchronization of files is not the issue here. That can be done with version control such as Git. Or in my case not an issue really as the client won’t update content or products so no new files will be added. The database synchronization is the issue.
Well there are three things you can do to keep your WooCommerce Stores in synch. You can export the products, variations,orders, refunds, coupons and webhooks using the WordPress export tool and import them. Two, you can use the Customer/Order/Coupon CSV Import Suite . This way they do keep in synch. The other way is just to leave database synching alone and update the live site with file changes and update the database by activating and changing content live. Here the three options in detail with pros and cons.
This can be done using the slightly buggy WordPress Importer Tool. I have used it before for importing and exporting basic content from one site to another. I have also used table export and import. And it does offer the option to export:
- Webhooks – see docs
There will be issues though as it is kind of buggy – new tools in the works for ages – and not a WooCommerce only tool. So definitely not my first choice.
Customer/Order/Coupon CSV Import Suite
Then you think well, let’s use the WooCommerce Addon – the Customer/Order/Coupon CSV Import Suite – mentioned earlier. That should do the job. Well, not quite apparently according to Mike Jolly. Mike Jolley, a WooCommerce Developer stated in this WordPress support thread that:
I think it’s safer to move code than move data, imo anyway. Especially if it’s constantly changing.
That makes sense and shops of course do change constantly. But sometimes, and I my case, it would be nice to do so. It would be great to move all files and the database once all is done and in the meanwhile keep things in synch.
There is another bigger issue he mentions though with exporting and importing WooCommerce data. And that is worse:
The orders you import may have different IDs due to auto-incrementing IDs in the database. The problem is IDs may differ from your emails + records.
So you could later on have issues with order IDs not matching emails and records. And that would be a big problem. However, Mike Jolley talked about this 8 months ago. Seems like the latest Customer/Order/Coupon CSV Import Suite can do more now .
Since June 2016 it can merge customer, order and coupon data that is. Isn’t that cool! Still, you could of course have to cough up $79, but that certainly can be worth it in many situations including mine. The main issue I was having is a difference in orders. And this addon should help me with that.
Updating Live with Local Site Data
The final option is just to not keep the database locally and on production in synch. You could test all needed changes locally and do them on live when all is done. That does mean more downtime or maintenance time. This as you would have to move all changed files, added theme, and plugins to live first. Activate them there. Then configure them and adjust content when need be. So this option really depends on how confident you are you can do all this in the maximum downtime allotted by you and your client.
What to Choose?
Well, in my case I will probably go for leaving database synchronization alone for now. I have not tested that addon and I prefer not to spend extra $ on this project now. I may use it in the future though. And if you read this post and are a developer with experience using that addon do leave me a comment. And if you are an end user, well perhaps the addon is the right choice for you. It does sound like an awesome tool and Skyverge is a solid company.
PS I do hope Delicious Brains will have Mergebot up and running soon so I do no longer have to deal with these database synch issues – post on it here.
Footnote Image of the White Rabbit in Alice in Wonderland by John Tenniel is in the in public domain