Pushing Changes to Live (Pro)
Push to live copies the database tables and files you choose from a staging site to your live site, so you can deploy what you tested without redoing it by hand. It is a Pro feature: without Pro, the push page says that pushing is part of Hera Backup Pro, and the Push to live action is not in the list.
Before you start
- Hera Backup Pro is active.
- The staging site's copy finished: its status is Completed. A staging site whose copy was cancelled or failed cannot be pushed.
- You are signed in as an administrator on your live site. The push cannot be started from the staging site.
- The live site and the staging site run the same WordPress version (the same major and minor version, such as 6.8). Otherwise the push is refused, with a message saying which one to update.
- No other backup is running, and the server has room for a full backup of the live site. The push takes that backup first and stops if it cannot.
Opening the push page
- Go to Hera Backup > Staging Sites on your live site.
- Click Actions in the staging site's row and choose Push to live.
On the staging site itself, the Push staging changes to live link in the admin bar opens the same page on the live site.
The page is titled with the staging site's name, for example Push "My Staging" to live.
The push wizard
The steps are listed down the side: Tables, Files and Confirm, then Progress while the push runs. Use Next and Back to move between them, and Cancel on the first step to return to the list.
- Tables: choose the database tables to push. Content tables are ticked by default, except those marked Live site data: tables the live site writes itself, such as WooCommerce orders and their related tables, Action Scheduler jobs, comments and user accounts (and the posts tables while the live site keeps orders in them). Untick live site data unticks any of those you ticked, and Toggle all content tables ticks or unticks all content tables. The
users,usermetaandoptionstables are listed separately under Site identity (not selected by default); tick one only if you changed it on the staging site on purpose, and read the note that appears when you do. Hera Backup's own tables are not offered. - Files: choose the folders and files under
wp-contentto push, such as a theme or a plugin folder. Nothing is ticked by default. Open a folder with its arrow to choose entries inside it, or tick the folder to push all of it. Select all ticks every entry shown. - Confirm: review what will be written. Each table is listed with its row count and each file entry with the number and size of its files. Then click Start Push.
On the Confirm step, Start Push stays disabled until you tick the confirmations that apply:
- If you ticked a Live site data table, tick Overwrite these tables on the live site.
- If rows were added on the live site after the staging copy was made, with ids the staging copy also uses, the step lists them per table; tick the box that confirms replacing them (for example Replace these 3 rows on the live site).
If you ticked a site identity table, the step also explains what each one changes, and warns that your login session may end when the push finishes. The push keeps running on the server; sign in again afterwards.
What happens when you push
The push runs on the server in the background, and the Progress step shows its current phase and percentage. The phases are:
| Phase | What happens |
|---|---|
| Preflight | Checked when you click Start Push: the copy is finished, your choices and confirmations are complete, the WordPress, PHP and MySQL versions still match, there is enough disk space, PHP can write every live file the push would write, and no other push of this staging site is running. |
| Pre-push Backup | A full backup of the live site is taken on this server and must complete. If it fails, or another backup is already running, the push stops before anything on the live site changes. This backup is kept for at least 7 days. |
| Push Database | The selected tables are written to the live site. Rows are written by id: a live row with the same id takes the staging row, and live rows the staging site does not have stay. Site identity tables are matched by name instead (option name, login). The staging address and folder are rewritten to the live ones in each row as it is written. A table the live site does not have is skipped. |
| Push Files | Each selected file is copied when it is missing on the live site or its contents differ. Nothing on the live site is deleted. |
| Post-push Hooks | Hooks that other code has registered for a push run here (see Hooks and Filters). |
| Verification | The push records what it moved. |
When it completes, Hera Backup flushes WordPress's object cache and permalink rules.
The live site is put into maintenance mode after the pre-push backup and taken out of it when the push ends; your progress page keeps updating meanwhile. WordPress itself ends maintenance mode about ten minutes after it starts, so on a longer push visitors can reach the site, and see partly updated pages, for the rest of it. Pick a quiet time to push.
Just before the database is written, Hera Backup counts again the live rows the push would replace. If more were added since you confirmed, the push stops with nothing changed; start it again to see and confirm them.
What is never pushed
wp-config.php,.htaccess, Hera Backup's backup folder (wp-content/uploads/hera-backup), its private file store (wp-content/uploads-private) and the staging site's sandbox file.- Hera Backup's own database tables.
- From the
optionstable: the live site's address (siteurl,home), its active plugin list, its search engine visibility setting, its scheduled tasks, its upload path settings, its database version, transients, and Hera Backup's own settings.
After the push
- The Progress step reports Pushed to your live site's host name, with the number of tables, rows and files moved, and offers Visit live site.
- The backup taken just before the push is your way back: the result links to it as Restore the backup taken before this push.
- If the push failed after its backup was taken, Roll the live site back restores that backup; confirm with Roll back now. If it failed before the backup was taken, nothing on the live site was changed.
- Check the pages and features you changed on the live site.
- The staging site is left as it was; keep working on it or delete it.
Notes
- Push only goes from staging to live. There is no way to refresh a staging site from live: create a new staging site for a fresh copy.
- Push only what you changed. Every ticked table and file overwrites what the live site has under the same id or path.