WordPress Staging Sites from the Ground Up: Getting it Done Manually (Part 2)
READING TIME: MIN
In the previous part of this series on Staging Sites, we looked at leaving the work to either your web host’s inbuilt options or to a dedicated plugin – but we also reminded you that to really get in the thick of things with experiments on your website, you would need to manually build a staging site. As your reliable WordPress agency for development, today we’ll make sure that doing this becomes a lot easier than it sounds.
To ensure you’re not working with one hand tied behind your back, our WordPress agency for development would recommend a subdomain of your website for the staging site and not the localhost – so instead of testing things on a completely different machine, you’ll also be able to reproduce the hardware conditions of your live site.
On to the steps, so pay close attention!
1. Make a subdomain
Your staging site needs a subdomain to inhabit, so on your hosting provider’s cPanel dashboard, locate and click on ‘subdomains’, then think of and type in a name for the staging site, just the way we did in Part 1.
2. FTP account for the subdomain
To provide the staging site with its own dedicated space, select the ‘FTP Accounts’ setting, and type in the details. Don’t forget to check that the root directory matches the one for your subdomain.
3. Upload WordPress files
Upload your files to the staging site through the FTP account we just made; of course, ensure that you’re on the latest version of WordPress. On the live site, in the “wp-content” directory, locate the subdirectories ‘uploads’, ‘plugins’, and ‘themes’, and make sure you upload them to the staging site. If the uploads are large, regular FTP might bog you down, so you would do well to direct them through File Manager in cPanel.
4. Exporting (and importing) the database
Now this particular step, of replicating the database from the live site for the staging site, would need a plugin, and for our purposes, we’ll pick WP Migrate DB. After you’ve installed it, you’ll find ‘Migrate DB’ under ‘Tools’.
Once you fill in the directory path and the subdomain URL correctly, the plugin will get to work and ensure all paths are precisely directed to the URL of the staging site, and you can now ‘Export’. Next, you’ll need to locate ‘MySQL Databases’ in your cPanel, and select ‘Create Database’, add a new user and give this user access to the newly created database. Then, under ‘PHPMyAdmin’, select the new database we made, and click ‘Import’ to upload the database file (the one we exported from WP Migrate DB). Clicking ‘Go’ will import the database into the staging site.
5. Editing wp-config
On your staging site, changes will have to be made to the file wp-config.php to use the new database and the new user. What you’ll need to ensure is that the database prefix you use here is the same as the one on the live site.
6. Login and Secure the site
Provided you followed the last 5 steps perfectly, finally, it’s time to use your login credentials for the staging site. However, you also need to be sure that the staging site is invisible to the general public, especially search engines that might index it. To prevent precisely that eventuality, our WordPress development agency recommends to pick ‘Reading’ under Settings, and check ‘enable site-wide password protection’.
Congrats!
And that concludes our series on Staging sites and this article on manually creating one. A staging site is a godsend when you want to improve the experience visitors have on your site without breaking what it already does, and we hope these guides have been helpful.
Of course, any decent WordPress agency for development would offer a staging site as part of their services, such as a Maintenance and Support Plan, so if these previous methods don’t seem right for you, feel free to check that out.
More on The Topic
- Why WordPress Multisite Is a Game-Changer for Enterprise Content Management
- How API Integration Enhances WordPress Functionality for Enterprises
- The Advantages of Headless WordPress for Enterprise-Level Websites
- Why WordPress Multisite is a Game-Changer for Enterprise Content Management
- The Role of API Integration in Modern WordPress Development for Enterprises
Tags: backupstagingWordPresswordpress agencywordpress developmentwordpress website