Open Source · MIT License

Live-to-staging sync,
as easy as it should be.

Sync live WordPress to staging with smart WooCommerce filtering and anonymization. Promote specific themes and plugins from staging to live with automated backup and automatic restore.

$ bash curl -sSL https://ada.tools/wp-stage-sync/install.sh | bash

Hey stranger. Don't trust anyone, and don't run random commands from the internet. Want to see what's inside the install script first? Download it and read it yourself. Or hand this prompt to your favorite AI agent and let it do the reading:

Fetch https://ada.tools/wp-stage-sync/install.sh and review it line by line. Start your answer with a "TL;DR" section: one line stating whether it's SAFE or NOT SAFE to run, in plain language a non-technical person can understand. Then add a detailed breakdown for those who want it: explain every command, flag anything unexpected, dangerous, or outside the scope of installing a single binary, and call out anything that touches my filesystem or requires elevated privileges.

See it in action.

Every step of the sync is guided by an interactive terminal interface.

WP Stage Sync — Welcome screen and directory selector
Credential extraction
Credential extraction
Sync parameters
Sync parameters
Table sync modes
Table sync modes
Rsync excludes
Rsync excludes
Sync in progress
Sync in progress
Results
Results

Everything you need,
nothing you don't.

Built for agencies managing multiple WordPress sites where a full-copy staging sync is risky, slow, or legally problematic.

Smart Auto-Detection

Automatically discovers WordPress installs from Apache2 / Nginx vhosts and filesystem paths. Parses wp-config.php to extract credentials with zero manual setup.

WooCommerce Order Filtering

HPOS-aware. Exports only the N most recent (or oldest) orders — not your entire order history. Keeps customer accounts only for those included orders.

Full WordPress Sync

No WooCommerce? It just works. Plain WordPress sites get a fast, complete copy of every table — no order filtering, nothing dropped.

Customer Anonymization

Optionally masks billing and shipping addresses, names, emails, and phone numbers in the staging database. Admin and editor accounts stay intact. Covers standard WooCommerce/WordPress fields — not a guarantee every plugin's PII is scrubbed.

File Sync via rsync

Syncs wp-content/ with customizable folder exclusions. Detects staging webroot ownership and applies the correct chown automatically.

Domain Mapping

Runs WP-CLI search-replace for domain URLs. Handles Elementor URL settings automatically, puts Jetpack into safe mode, so your staging sites works out of the box.

Production Guardrails

The production database is strictly read-only — zero INSERT, UPDATE, or DROP, ever. Promote writes only the theme and plugin files you pick, always after a full backup with automatic restore.

Promote & Restore

Surgically promote specific themes, plugins, and mu-plugins from staging to live. Automated tar.gz backup before each operation with automatic restore on failure.

Dry-Run Preview

Run with -n to see exactly what a sync would export, transfer, and replace — every table, file, and command — without writing a single byte.


Four steps, fully automated.

Run wp-stage-sync and the interface walks you through each phase.
After saving settings, use -u for unattended runs. Use it in crons, in automations...

Step 0

Database Export

Queries live DB read-only. Filters HPOS order tables, excludes bulk session data.

  • Target N orders from wc_orders
  • Linked customers preserved
  • Structure-only export for specific tables
  • Custom rules for order related tables
Step 1

Database Import

Drops all staging tables, imports clean with foreign key checks disabled.

  • Full staging DB reset
  • FOREIGN_KEY_CHECKS=0
  • Anonymization applied here
Step 2

File Sync

rsync with --delete, skipping cache and build artifacts.

  • Excludes cache, ewww, litespeed, updraft etc.
  • Toggle exclusions in interface
  • Auto-detects ownership
Step 3

Post-processing

WP-CLI handles domain replacement and plugin-specific URL rewrites.

  • wp search-replace all tables
  • Elementor URL replace
  • Jetpack safe mode
  • Cache flush

Built for HPOS. Not compatible with legacy order storage.

wp-stage-sync queries wc_orders directly and filters all HPOS lookup tables by order ID. Backwards compatibility mode (legacy wp_posts-based order tables) is not supported.

wc_orders wc_order_addresses wc_orders_meta wc_order_stats wc_order_product_lookup wc_order_tax_lookup wc_order_coupon_lookup

Production is safe.

The production database is enforced read-only at the query level. The default Live → Staging sync never writes to production at all; promote writes only the files you select, always after a backup.

Read-only live connection

Only SELECT and SHOW queries run against the production database — in both modes. Zero database writes, ever.

Path validation

Aborts if live and stage directories resolve to the same filesystem path (symlinks included).

Database validation

Aborts if live and staging resolve to the same database — compared by server identity, not just the host string.

Backed-up promotes

Promote writes the files you select to live by design — after a full backup, with automatic restore on failure. The live database is never touched.


Up and running in seconds.

Requires Linux with MySQL/MariaDB, rsync, and WP-CLI available. Go 1.21+ only needed if building from source.

Quick Install

curl -sSL https://ada.tools/wp-stage-sync/install.sh | bash

Auto-detects amd64 / arm64. Resolves the latest release tag via GitHub API. Piping to bash? Did you see the disclaimer?

From Source (Requires Go 1.21+)

go install github.com/AdaDigitalAgency/wp-stage-sync/cmd/wp-stage-sync@latest

Then: run wp-stage-sync for the interactive interface, or wp-stage-sync -u for unattended mode.

Self-update

wp-stage-sync --update

Downloads latest release and replaces the binary in-place.

Unattended mode

wp-stage-sync -u

Skips interface, reads saved config from ~/.config/wp-stage-sync/sites/. Perfect for cron.

Dry run

wp-stage-sync -n

Preview a sync without writing anything. Prints what would be exported, transferred, and run. Also available as --dry-run.

Version & Help

wp-stage-sync --help

Print available commands, flags, and usage examples. Use --version to check current binary version.

Promote

wp-stage-sync --promote

Promote themes, plugins, and mu-plugins from staging to live with automated backup.

Restore

wp-stage-sync --restore

Browse and restore previous backups from the TUI.

List sites

wp-stage-sync -l

Show all configured sites with their live → staging mapping.

Target site

-s example.com

Target a specific site. Supports multiple WP installs per server.

Delete site

--delete -s example.com

Remove a site's config and backups. Prompts before deleting.

Reset all

wp-stage-sync --reset

Wipe all saved configs and start fresh. Prompts before deleting.

Settings Screen

Press 's' from TUI startup screen

Configure backup retention limits and automatic cache flushing. Persisted in settings.json.


Built by an agency, for agencies.

wp-stage-sync is open source and MIT-licensed. If it saves you time, a star goes a long way. PRs and issues are welcome.

wp-stage-sync is an independent, open-source project. It is not affiliated with, endorsed by, or sponsored by WordPress, WordPress.org, the WordPress Foundation, or Automattic. The WordPress® trademark is the property of the WordPress Foundation.