Pushing staging changes to the live site
A push copies the test site over the live one. Decide what moves before you press the button, because a full push can overwrite things your visitors added while you were testing.
The risk is real for any site that collects data. The database holds your orders, comments and form entries, and the live one keeps growing while you work on the copy.
What a push can overwrite
One host's documentation is blunt about it. Its tool "does not distinguish between new and old orders during staging-to-live pushes"1. Push all files and the database, and "the live site is overwritten exactly as staging is"1.
That's about shops, but the same logic applies to any site where visitors leave something behind. Comments, bookings, member sign-ups and form entries all live in the database. The copy has the data from the day it was made, not today's.
Files are different. Your theme, plugin files and uploaded images are mostly your own work, so moving them is the usual job. The database is where the danger sits.
Three routes the host documentation gives
For shop sites, the host suggests these workarounds1:
- "Push only files (leave the live database intact)."
- "Selectively push database tables, excluding WooCommerce tables."
- "Sync live database to staging first, then push staging to live."
Which fits depends on what you changed.
If you edited a theme or a plugin's files, a files-only push is the simplest. Settings that live in the database, like a changed plugin option, won't come across, so you'd repeat them by hand on live.
If you changed pages or settings stored in the database, a selective push of specific tables is tighter. You need to know which tables hold what. That's a job for your developer or your host's support, and the host itself says to consult your developer1.
The third route refreshes the copy from live first. Your test changes would then be lost or need repeating, so it suits cases where you can redo them quickly. It also leaves a gap. Orders that arrive after that refresh and before your push can still be overwritten.
Before you push
Do these in order:
- Finish your checks for the test copy on the copy.
- Take your own backup of the live site, even if the host makes one.
- Pick a quiet time, since one host suggests off-peak hours1.
- Pause anything that adds data to the live site, if you can, such as an open sale.
The backup isn't a complete safety net. One host makes a backup before pushing. It warns that "data created between the push and a potential rollback may be lost"2. A rollback puts back the old state. Anything added in between goes with the push.
What else travels with a push
Settings can move too. The host says "Redirects, geolocation, PHP, and Nginx configurations are always included" in a push2. So check them first.
Passwords don't always come along. The host says "you must re-enable it on the destination environment after the push" for password protection2. If your live site wasn't locked before, there's nothing to do. If it was, check it's back.
Search settings need a look as well. If you hid the copy from search engines, make sure that setting didn't reach the live site. The search-hiding steps explain the settings.
Platform tools that sync for you
Some platforms have a sync option. One help page describes fixing a fault by choosing to "sync your changes from staging to production"3. Read what the sync includes in your own platform's documentation, and whether orders and comments are part of it.
After the push
Clear caches, which are saved copies of pages that make a site faster. The host advises "Purge any built-in cache (theme or plugin)" and clearing your browser cache2.
Then look at the live site as a visitor would. Open the home page, a post, a form and the checkout. Place a small genuine test only if your shop tools allow it. If something's wrong, restore your backup or ask your host.
Notes and sources
- Push Environments, Kinsta Docs
- Push Environments, before and after the push, Kinsta Docs
- Use a staging site to troubleshoot errors, WordPress.com Support