What are environments?
In software development, an “environment” refers to a set of configured software and hardware tools where software, in our case WooCommerce, runs. Developers typically use three environments in their software development process. There is a development environment for their daily work, a so-called staging environment where they present the newest features to their clients, and the production environment the business uses for its operations.
Why are these environments essential?
Using these environments makes the software development process go through a checkpoint where clients and developers can ensure that the soon-to-be-published software works as intended.
Why do not WooCommerce developers use these environments?
Most WooCommerce developers only use one environment: production. With every change they make, they risk crashing the webshop customers are actively using. This is, of course, a huge stress for the developers and the business owners, too. Sadly, WooCommerce, and for that matter WordPress, was not initially designed to follow this best-practice process. WooCommerce stores product and order data in the same place as parts of the website itself, which makes it really difficult for developers to publish their changes from the staging environment to the production without overwriting order and product changes. Although there are efforts from the WooCommerce authors to counter these original design decisions, it still remains an issue for the foreseeable future.
How can we help?
We have created a novel method for managing multiple environments for WooCommerce, safely publishing changes while maintaining the production environment’s data integrity.
The following steps can outline our method:
- We create a staging environment by cloning the production environment using EBS snapshots on AWS.
- Developers can make changes directly in the staging environment or deliver their code via a CI/CD pipeline.
- When changes are ready to be published, we copy the product and order changes programmatically using the WooCommerce REST API.
- We move the merged changes back to the production environment using EBS snapshots.
We currently use this process to manage deployments for fitness-index.hu, a WooCommerce webshop with thousands of fitness products.