A WordPress staging website is an exact coy of your production website but you can use it to preview changes to posts or page, upgrades to WordPress core, plugins or themes files or any other changes you wish to make to throughly test before applying them to your production website. By using a staging environment for your WordPress website you can prevent any updates from breaking your existing configuration.
In this guide we will be using the Softaculous one click installer that comes with most website hosting packages. By using the staging environment built into Softaculous, you can create and manage your websites using one click and push the staging environment into your production website environment easily. The process other than logging into your control panel is the same irrespective whether you are using DirectAdmin or cPanel.
CREATE WORDPRESS STAGING ENVIRONMENT
Log into your web hosting control panel, for cPanel you will use https://domain.com:2083 or for DirectAdmin you will use https://domain.com:2222. Once you have logged into your hosting account click on the Softaculous icon. This will open the Softaculous User Panel.
Once in the Softaculous User Panel click on the Installations in the top task bar.
Select the WordPress installation you wish to create a staging website for and the click on the Create Staging icon.
The staging WordPress installation will appear where you can select your installation URL, protocol, directory and database name. After completing the details click on the Create Staging button and Softaculous will create an exact replica of your website using the details you selected above.
PUSH STAGING TO LIVE ENVIRONMENT
From the Softaculous User Panel click on the Installations in the top task bar. Select the website you want to push to live and click on the Push To Live icon.
Once you have select the Push To Live icon, you will be presented with some option of how you want the it to proceed. You can either select the Default and Customise Options from the tab menu.
The default option will push the current staging website to your production website and will copy over all files and databases as is. Before making any changes the Softaculous installer will backup your production website, then copy and replace your production installation with the files from your staging environment, delete the current database and replace with the database from the staging environment.
The customise options will allow you to choose what changes get push from your staging website to your production website. From the menu you can just push the files across, import the full database including any structure changes or any data from a table, import only the database structure or import only the data from the database tables. Before making any changes the Softaculous installer will backup your production website, then copy and replace your production installation with the files you have chosen in the customise options.
Once you have decided on using either the default or customise option, just click the Push To Live button and Softaculous will complete the transfer from the staging environment to your production website. Once completed you will be presented with a success message and you can then log into your production website to check everything is working as expected.