How to make your WordPress staging site live
This guide will show you how to make the changes on your staging or development environment live. We’ll be referring to a WordPress site in this guide, however the same steps can be followed for any web app in our 1-click utility.
Tip: If you haven’t already created your staging or development site, you probably want to learn how to create a staging copy of your site first.
We’ll refer to it as a staging site in this article, so if you called your staging site dev, development or testing or something else entirely, be sure to swap staging for whatever you called it.
These steps use our specialized software configuration which makes use of Plesk control panel and Installatron (1-click web apps) for easy web application management. If you are not hosted with us, but your web host uses these tools as well, then this guide will work great for you too.
Table of Contents
Want to be able to sync your staging site to live with a single click?
There are a few methods for syncing your data between staging and the live site:
- Fully Automated sync: useful for less dynamic sites and it’s totally automatic!
- Selective Copy: useful for highly dynamic sites, but it’s a manual process
- Delete and Clone: works similarly to the fully automated sync. Good fallback option in case auto sync isn’t working for you.
Option A: Fully automatic sync
The sync option in 1-click web apps will overwrite the live website with the staging site, so be sure that the staging site is exactly how you’d like the live site to look, content included.
If new posts of any kind (posts, pages, orders, menu items) have been added to the live site since the staging site was created, that content will be erased and overwritten by the content from the staging site therefore you will need to update the staging site with the new content on the live site before syncing staging over to live.
How to update the staging site with new content from live
The following are a few different ways to transfer changes on live to staging.
Tip: you won’t have to do this part if the content you wish to save has its data stored in a dedicated table in the WordPress database. Take a look at the “Exclude content during sync” section below for more information on this.
- The manual method: Manually copy and paste any changes you made on live since you created the staging copy on the staging site. This is simplest when there’s only been one or two small changes made to the live site.
- WP All Export/Import Plugins: An alternative to the built-in WordPress export/import tools is the WP All Export and WP All Import utilities. They will help you export and import only new posts/pages/customers/orders/users from live to staging. See their documentation on how to migrate data between WordPress installs. These utilities do not suffer from the default PHP timeout preventing a complete import and they have automatic detection and prevention of duplicate posts. Note: for basic page/post migration, the free versions should do the trick.
- WordPress Official Export/Import plugins: Export the content from live and import it to the staging site:
- Follow the steps on wordpress.org to exporting content on your live site. It’s best to export each post type that you need to copy over in separate exports (ex: pages, posts). When prompted, select the date range that starts with the date you made your staging copy and ends with today’s date.
- Temporarily increase the PHP timeout value for the domain in Plesk to 300 (which is 300 seconds / 5 minutes). Be sure to set it back to the default value after you’ve completed the import in the step below otherwise the high timeout value could, in select circumstances, have detrimental effects on the performance of your site. You do not need to do this if you will be using the more advanced wp-cli import option mentioned below.
- Follow the steps on wordpress.org to importing content on your staging site. Advanced: if you have a very large quantity of content (in particular media) to import, you may alternatively use wp-cli to import without timeouts.
- Use the plugin’s specific export/import option. For example if the data you’re most concerned with saving is in a contact form plugin, usually those plugins have their own export/import option (or it integrates with WordPress’s export/import as in option (3) above). You can then export from live, import into staging and you’re all set!
Once your staging site is 100% ready to be made live, with all content updated and ready to go, follow these steps to sync your site from staging to live, overwriting the live site:
- Login to Plesk then select the 1-click web apps (or Installatron) button to be taken to your list of installed applications.
- Find your live site in the list and click first on the wrench icon, and then on the sync icon with the two arrows in a circle. (If you do not see the sync icon, check the troubleshooting section below for details on how to fix this).
On this next screen you’ll see a list of files and a list of database tables. You can deselect those files and tables that you do not want to overwrite on the live site.
If, since the date you created the staging site, you or your site’s users have not altered or added any content on the live site (posts, pages, comments, WooCommerce orders, etc), simply leave everything checked and proceed with the sync to make your staging site live.
Excluding content during sync
This can be crucial for sites with a lot of comments, or other live data that should not be overwritten. CHOOSE CAREFULLY which tables you select/deselect here.
If you have only edited files (like the theme or a custom plugin) on the staging site, and nothing in the database, then you can safely uncheck all database tables (the second list on this page) to complete a file-only sync, making your staging changes live.
Excluding Comments or Users
To skip syncing WordPress comments, uncheck the wp_comments
and wp_commentmeta
tables (as highlighted in the screenshot)
To skip syncing WordPress Users (including WooCommerce Customers), unchecking the wp_users
and wp_usermeta
tables (not shown in screenshot).
Then at the bottom of the screen you should leave the option to make a backup before syncing enabled, and finally click the Sync button.
And you’re done! If there’s any issue with the live site after the sync, you can always head to the Backups tab and restore the backup that was completed just prior to the sync.
That’s it! See Next Steps below for optional final changes
Option B: Selective Copy
If you have a WooCommerce store, or membership site with new data being created daily, it may be tricky to identify the individual content pieces that have changed. In such cases a manual copy of changes made to the staging site over to live may be preferred, rather than using the sync tool to do it all at once. Here’s a couple helpful tips on this:
- If you have made changes to the theme that save to the database (like using Customizer does in WordPress), use a customizer export/import tool that will allow you to copy the theme settings from the staging site to the live site.
- If you’re using BeaverBuilder and changing existing pages, you can save page templates for each page you’ve altered and then export those templates from staging and import them into live.
That’s it! See Next Steps below for optional final changes
Option C: Remove live, then clone staging to live domain
This is an older method that we used prior to the introduction of the sync tool, but it can still be used if you prefer it, or if the sync tool isn’t working for you.
- Login to Plesk then select the 1-click web apps (or Installatron) button to be taken to your list of installed applications.
- For your live site, click the curved arrow button to complete a backup then choose the X button to remove the live app.
- Find your staging application install in the list of web apps
- Clone your staging app using the button with the two side-by-side arrows pointing down. More details on this process here. Your destination for the clone will be the live domain as we are copying the site from staging to the live URL.
That’s it! See Next Steps below for optional final changes
Tip: if you get an error like “! An instance of wordpress already exists in this directory”: this means you didn’t remove the app (ie: you need to complete step 2).
Next Steps, Tips, and Troubleshooting
Below you’ll find some recommended next steps to complete to ensure your changes show correctly on the live site.
Clear Caches
It’s recommended to now clear the cache within any caching plugins you have on the live site, otherwise it may still show the old site or elements of the old site to visitors until the cache’s standard timeout hits (could be many hours or days).
To avoid your browser’s cache from interfering with this process, you should also clear your browser cache at this time.
Staging Site Lock-Down / Removal
Now that you’ve rolled out your staging site changes, if you won’t be making any changes to your staging site any time soon, it’s strongly recommended to remove the staging site from within 1-click web apps. It’s not likely to do you any good anyway (unless you’re planning to continue making changes) as by the time you next need a staging site a fresh clone is going to be your best bet.
To do this, in Plesk go to 1-click web apps, find the install in the list that references your staging URL (like staging.<yourdomain>) and click the X button beside it. You can always take a backup first if you’re not sure!
SEO TIP: If permalinks/page URLs have changed on the staging site
When it goes live, you will want to ensure you either rename all the new page URLs to the original value OR create 301 redirects for each one that has changed. This is necessary at bare minimum for SEO purposes. Details on creating 301 redirects here.
Can’t find the sync button in 1-click web apps?
If you’ve followed the steps above and are trying to sync your staging site changes back to live, but there’s no sync button, this is because you cloned the site without checking the box indicating that the clone is to be a staging site.
Not to worry, this can be easily fixed up! In 1-click web apps, select the wrench icon beside the staging site, choose the Advanced tab, and look for the field called “Live Installation URL”. Enter the URL to the website: you will need the http// or https:// but do not include a slash at the end of the URL. Scroll down and press save. You can now follow the steps above under Part 3 Option B.
Posted in News & Info
About Websavers
Websavers provides web services like Canadian WordPress Hosting and VPS Hosting to customers all over the globe, from hometown Halifax, CA to Auckland, NZ.
If this article helped you, our web services surely will as well! We might just be the perfect fit for you.