Lesson 9.3. Updates, Hosting, Deploy

Goal

Update WooCommerce and plugins safely and deploy store changes on managed hosting.

Key concepts

  • Updates: staging → check the templates (Status) → WooCommerce database update → test checkout → production
  • The WooCommerce database update runs through Action Scheduler; large stores — at low-traffic hours
  • Managed hosting: WP Engine, Pantheon, Kinsta — staging/dev environments, their own cache, file system limits
  • Pantheon: Dev → Test → Live, code only through git, the Live file system is read-only (except uploads)
  • Host cache: exclusions for the cart, checkout, My Account and the WooCommerce cookies
  • Code is deployed through git/CI; the database and orders are never "pushed" from staging to production

Diagram

flowchart LR
  DEV["Local<br/>wp-env"] -->|"PR + CI"| STG["Staging<br/>a copy of production"]
  STG -->|"test checkout,<br/>templates, DB update"| PROD["Production"]
  PROD -. "database and uploads<br/>only down" .-> STG

Code

The WooCommerce update checklist:

BASH
# on staging, a fresh copy of production
wp plugin update woocommerce --dry-run
wp plugin update woocommerce
wp wc update                       # WooCommerce database schema update
wp wc tool run verify_db_tables --user=1
# next: WooCommerce → Status → Templates, a test order in both checkouts

A deploy from GitHub Actions (excerpt):

YAML
- name: Deploy plugin
  run: rsync -az --delete ./build/my-wc-extension/ ${{ secrets.SSH_TARGET }}:${{ secrets.WP_PATH }}/wp-content/plugins/my-wc-extension/
- name: Flush caches
  run: ssh ${{ secrets.SSH_TARGET }} "wp --path=${{ secrets.WP_PATH }} cache flush && wp --path=${{ secrets.WP_PATH }} transient delete --expired"

Common mistakes

SymptomCauseFix
After the update 2 hours of orders are goneThe staging database was pushed to productionCode goes up, data only goes down
Customers see other people's cartsThe host cache caches the cart or checkoutExclude the WooCommerce pages and cookies from the cache
A plugin can't write a file on Pantheon LiveThe file system is read-onlyWrite to uploads or the database, generate files at build time

Weak and strong answer

Question: How do you update WooCommerce on a live store?

Weak answer. I click "Update" in the admin when a new version comes out.

Strong answer. First on staging, a fresh copy of production: I read the changelog, update, run the database update, look at outdated templates and place an order in both checkouts with a test payment. Then production at low-traffic hours with a backup and a rollback plan. I don't install major versions on release day — I wait for the first patches.

Why the second is stronger: A process with risks and a rollback, not a single action.

Practice

Describe the update process for a store on WP Engine or Pantheon: environments, steps, who checks what, the rollback plan. In the terminal go through the update on staging: the version, a dry run, the update, the database update, the table check.

composer / wp — Module 9. Quality and Production

Interview Questions

Production keeps getting new orders, customers and stock changes. Moving the staging database would overwrite that data. Settings changes are moved by hand, with migration scripts or by exporting specific settings.

The cart, checkout, My Account and requests with the woocommerce_items_in_cart, woocommerce_cart_hash, wp_woocommerce_session_* cookies. Managed hosts usually do it themselves, but it has to be checked.

Clear Dev → Test → Live environments, code only through git, a read-only file system on Live and Test (except uploads), built-in Redis and edge-level caching.

Save your progress

Sign in or create a free account to mark lessons as completed and continue the whole course. You will come back to this lesson.