Local debugging gets better the closer it matches production. WP Staging CLI creates sites on nginx and MariaDB 11.8 by default — and every site can opt for Apache and MySQL, at a database version you pick, without a global reconfiguration.
Run a Site on Apache
wpstaging add mysite.local --use-apacheMove an existing site between the two web servers at any time — the site keeps its files and database:
wpstaging reconfigure mysite.local --use-apache
wpstaging reconfigure mysite.local --use-apache=falseRun a Site on MySQL
Switch the database server and pin a version:
wpstaging add mysite.local --use-mysql
wpstaging add mysite.local --use-mysql --db-version=5.7Available versions: MariaDB 10.11, 11.4, and 11.8 (default), MySQL 5.7 and 8.4 (default when you use --use-mysql).
Change the Database of an Existing Site
Rebuilding on a different database server replaces the database files, so restore the site data from a backup in the same step:
wpstaging reset mysite.local --use-mysql --db-version=8.4 --from=./backup.wpstgWhy Match Production
- Reproduce issues that only MySQL 5.7 shows — for example, strict-mode and grouping differences.
- Test a client site that really runs on Apache, including its rewrite rules.
- Try the stack you plan to migrate to — MariaDB or MySQL, at the target version — before touching production.
Database Tools Either Way
Every site ships with the Adminer database UI at https://mysite.local/adminer/, and you can reach the command line with wpstaging shell-db mysite.local or wpstaging wp db query.
Next Steps
- Manage Docker WordPress Sites – every option when you add a site
- Docker Configuration – the generated Docker configuration files