Before we learn how to create a staging site, we must know some basics about staging environments, Let’s start. A staging site is a testbed where you can test whether any changes you have planned for your website work as expected.
Table of Contents
For example, if you’re thinking about installing a plugin on a WordPress website, you’ll probably want to make sure it’s not causing any compatibility issues with other themes and add-ons. With a staging site, you have an identical environment as your main project, so you can test that everything works properly before pushing the new plugin to production.
How to Create a Staging Site
Let’s take a look at the various options for creating a staging environment.
Creating a Staging Site via Softxaa WordPress Manager
If you use one of Softxaa’s HostPanel-managed WordPress Cloud Hosting plans or a VPS plan, there is an even easier way to create a staging environment for your WordPress website. Softxaa WordPress Manager is equipped with this kind of functionality, and we will now show you how easy it is to take advantage of it.
Here are the steps:
1. Log into HostPanel’s User Interface.
The default HostPanel login URL is https://domain.com/hostpanel/ (don’t forget to replace domain.com with your actual domain name).
2. Open the Softxaa WordPress Manager.
Softxaa WordPress Manager is available under the Tools section on HostPanel’s homepage.
3. Open the Actions drop-down and select Clone.
At the bottom of the page, you’ll see a list of all the currently active WordPress installations in your account. Next to each installation, you will find an action button. Please open it and select Clone.
4. Set the staging environment’s URL.
HostPanel will ask you to enter the URL of the clone installation. You can set it as a subfolder or you can use a subdomain or addon domain. When you’re ready to click Clone.
Softxaa WordPress Manager will automatically copy the original installation files to the new location and clone the database. You will have a carbon copy of the original installation with the same themes, plugins, users, and content.
How to Create a Staging Site for a Custom-Coded website
Cloning a WordPress website is easy because you have plenty of tools & plugins that can automate the process for you. However, if you have a custom website, these tools may not help you. If this is the case, you will need to clone your website manually.
It’s not as easy as using a plugin or other automated tool, but it’s not exactly difficult either. Here you will find the exact step-by-step process, which you need to do.
1. Copy your production site’s files and paste them into the clone site’s location.
Since FTP clients like FileZilla present some limitations in copying files to the server, it’s best to use HostPanel’s file manager. Navigate to your site files, select all files and folders, and use the Copy button to save to the server’s clipboard.
2. Create the staging folder.
You need to paste the files into the staging directory. If you are going to use a subfolder (eg, domain.com/stage), you can create the folder from the file manager. To host the clone website under a subdomain (eg, stage.domain.com), you need to set up a subdomain and keep its document root.
3. Paste the files into the new folder.
How long you have to wait for the transfer to complete depends on the size of your site and the hardware resources of the server.
4. Export your site’s data.
Along with copying the files, it’s time to clone your site’s database as well. It is important to create a separate database for the clone site, this way, you ensure that any changes you make to the staging site will not affect the production environment.
To export your main website’s database, you need to open phpMyAdmin, select the right database and go to Export. You can use Quick Settings and download the data to your personal computer as an SQL file.
5. Create a new MySQL database and user.
Next, you need to create an empty database, into which you will import your site data. A database user is also required so that your staging website can communicate with it.
HostPanel users can create a database and users through the MySQL database tool available on HostPanel’s homepage.
6. Import your main site’s data into the new database.
You should now go back to phpMyAdmin, select New Database, and go to the Import tab. The interface shows you different options and explains in detail what each of them does. In most cases, however, you just need to click the Choose File button and select the SQL file you exported earlier.
7. Configure the staging site to work with your new database.
Finally, you need to link the clone site to your new database. How you do this depends on how your website is designed. Most likely, you will need to edit a configuration file, although in some cases, you may need to modify some entries in the database to make the clone site work with its URL.