Using Staging: Pushing to Production and Pulling from Production
Using Staging: Pushing to Production and Pulling from Production
This article covers the staging workflow after you have created a staging environment. If you have not set one up yet, see Using Staging Environments first.
The Two Directions
| Direction | What it does | When to use it |
|---|---|---|
| Push to Production | Overwrites your live site with staging content | When staging changes are tested and ready to go live |
| Reset from Production | Overwrites staging with your current live site | When you want a fresh copy of production to test against |
Pushing Staging to Production
This replaces your live site with what is on staging.
- Go to your site in KPanel and click the Staging tab
- Scroll to the Push Staging to Production section (outlined in red as a warning)
- Choose what to push using the checkboxes: Files, Database, or both
- If pushing the database, keep Rewrite URLs ticked -- this automatically replaces the staging URL with your production URL across the database
- Tick the confirmation checkbox: "I understand this modifies my live production site"
- Type your production domain name in the confirmation field
- Click Push to Production
A pre-push backup is created automatically before any changes are made to production. If the push fails partway through, production is rolled back to that backup.
The push typically takes 30-60 seconds for small sites, longer for large databases or many files.
Resetting Staging from Production
This replaces your staging site with the current live site. Use this to get a fresh copy of production when:
- Production has had changes made directly (content updates, orders, new users)
- You want to start a new round of testing from the latest live state
- Staging has drifted too far from production to be meaningful
Steps:
- Go to your site in KPanel and click the Staging tab
- Find the Reset from Production section
- Choose what to sync: Files, Database, or both
- Click Reset from Production
This overwrites staging content. Anything you had on staging that was not pushed to production is lost.
URL Rewriting on Push
WordPress stores its own URL in the database (wp_options table: siteurl and home). It also appears in post content, meta values, and widget settings.
When you push staging to production, the Rewrite URLs option (available when Database is ticked) automatically runs a search-replace across all tables to swap the staging URL for your production URL.
If you push files only, or if the URL rewrite does not catch everything, use the WordPress Search & Replace guide to fix any remaining staging URLs manually.
Checking the Staging URL
Your staging site runs at staging.yourdomain.com. Click Open Staging in the Staging tab to open it in a new tab.
The tab also shows when staging was last synced and when it was last pushed to production.
Staging and WooCommerce
If you are running WooCommerce, avoid pushing the database from staging to production if the live store has received orders since the last reset. Pushing staging's database will overwrite those orders.
Recommended approach for WooCommerce: push files only (theme, plugin changes), and make any database-level changes directly on production using maintenance mode.
