A staging site is a testbed where you can check whether any changes you’ve planned for your website work as expected.
For example, if you’re thinking of installing a plugin on a WordPress project, you’ll likely want to confirm that it doesn’t create 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 if everything works fine before pushing the new plugin to production.
Let’s have a look at the different options for creating a staging environment.
Creating a Staging Site Using WP Staging Plugin
As is usually the case, if you use WordPress, you can rely on the enormous pool of plugins. The WP staging plugin creates a clone website with a copy of your database on a subfolder of the main WordPress installation.
Here’s what you need to do.
Install WP Staging on your WordPress
The first thing to do is install and activate the WordPress Staging plugin if you haven’t already. The steps below will take you through it.
1. Go to Plugins on your WordPress Dashboard.
2. Click Add New.
3. Go to the search box on the top right of the page and type in “WP Staging.”
4. Once you find WP Staging, click on Install Now.
5. Hit the Activate button.
Run WP Staging plugin on WordPress
The following steps will teach you how to begin the cloning process.
6. You’ll see WP Staging Pro features on the next page. Click “Skip – Start Cloning” at the bottom to begin the cloning process.
- Next, Click on Create new staging site.
8. In the following step, name your new staging site and hit the Start Cloning button.
Depending on the size of your website’s database, the cloning process might take a while.
- After cloning, click Open staging site (login with your admin credentials) at the bottom of the page.
10. The following page will deny you access. Login with your Username and Password to gain access.
11. Type in your login details appropriately, and hit the Login button as shown below to access your cloned site.
Once you’re in, you’re good to go. Your new staging site is a perfect replica of your main site, but for a few differences like the unique URL and orange-colored tab at the top.
The second way to create a staging site is manually. You might find it difficult to manually create a clone site if you have little to zero knowledge about programming, databases, and working with the phpMyAdmin. A lot could go wrong, and you might end up with a crashed site.
A WP plugin can certainly remove a lot of the dangers of doing everything on your own. However, if you’re a ScalaHosting customer, it’s not the only way of setting up a staging environment.
Creating a Staging Site via SWordPress Manager
If you use one of ScalaHosting’s SPanel managed VPS plans, you have an even easier way of creating a staging environment for your WordPress project. The unique SWordPress manager is equipped with this sort of functionality, and we’ll now show you just how easy it is to take advantage of it.
Here are the steps:
1. Log into SPanel’s User Interface.
The default login URL is https://yourdomain.com/spanel/ (don’t forget to replace yourdomain.com with your actual domain).
2. Open the SWordPress Manager.
The SWordPress Manager is available under the Tools section on SPanel’s homepage.
3. Open the Actions menu and select Clone.
At the bottom of the page, you’ll see a list of all the active WordPress installations currently on your account. Next to each of them, you have an Actions drop-down menu. Open it and select Clone.
4. Set the staging environment’s URL.
SPanel will ask you to enter the clone installation’s URL. You can either set it as a subfolder of your primary domain or you can use an addon domain or a subdomain. When you’re ready, click Clone.
SWordPress will automatically copy the installation’s files in the new location and will clone the databases. You’ll have a carbon copy of the main installation with the same themes, plugins, users, and content.
Creating a Staging Environment for a Non-WP Site
Cloning a WordPress site is easy because you’ve got plenty of tools that can automate the process for you. However, if you have a custom website or use another CMS, these tools may not be at your disposal. If that’s the case, you’ll need to manually clone your website.
It’s nowhere near as easy as using a plugin or another automated tool, but it’s not exactly difficult, either. Here’s what you need to do.
1. Copy your site’s files and paste them in the clone site’s location.
Because FTP clients like FileZilla present some limitations when it comes to copying files on the server, it’s best to use your web hosting control panel’s File Manager. Navigate to your site’s files, select all files and folders, and use the Copy button to save them in the server’s clipboard.
2. Create the staging folder.
You’ll need to paste the files in the staging directory. If you’re going to use a subfolder (e.g., yourdomain.com/stage), you can create the folder from the file manager. If you want to host the clone under a subdomain (e.g., dev.yourdomain.com), you need to set up a subdomain and keep note of its document root.
3. Paste the files and folders into the new folder.
The time you’ll need to wait for the transfer to complete depends on your site’s size and the server’s hardware resources.
4. Export your site’s data.
With the files copied, it’s time to clone your site’s database as well. It’s important to create a separate database for the clone site, as that way, you’ll ensure that any changes you make to the staging site won’t affect the production environment.
To export your site’s database, you need to open phpMyAdmin, select the correct database, and go to Export. You can use the quick settings and save the data to your local computer as an SQL file.
5. Create a new MySQL database and user.
You next need to create an empty database into which you’ll import your site’s data. A MySQL user is also required so your staging website can communicate with it.
SPanel users can create a database and user via the MySQL databases tool available on the User Interface’s homepage.
6. Import your site’s data into the new database.
You now need to go back to phpMyAdmin, select the new database, and go to the Import tab. The interface shows you a variety of different options and explains in detail what each of them works. In most cases, however, you simply 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 tell the clone site which database to work with. How you’re going to go about this depends on how your website is built. Most likely, you’ll need to edit a configuration file, though in some cases, you might also need to modify some entries in the database to make the clone site work with its URL.