Ready to go live with your new website? This guide advises steps on how to push your cPanel hosted staging sub domain to the production domain. Take note this guide is WordPress specific however the steps could be easily adjusted for most content management systems.
To complete this guide you will need your Serversaurus cPanel login details (these can be found within the Welcome to Serversaurus Business Hosting email which was emailed during your product order).
1. Using WP Migrate DB plugin, we're going to update the staging websites database to the new domain name and document root. So login to WordPress dashboard >> Plugins >> Add New >> Install WP Migrate DB >> Activate Plugin.
Then navigate to Tools >> Migrate DB >> Migrate >> Search & Replace >> Update the Replace fields with the production domain and new directory path, for example:
Once you've filled out the details, select Search & Replace at the bottom of the page to initiate the process, once processing is complete, the staging website will be dysfunctional. Do not worry, this is all part of the process.
2. Open Terminal and SSH to your hosting server (update the following command with your server login details):
3. Let's move the current production site to a backup directory:
mv public_html/ backup
4. Now we'll move the staging directory to the production domain document root, update the following command with your staging directory:
mv staging.yourdomain.com/ public_html
5. If applicable, login to WordPress dashboard and clear all website cache.
Your new website will now be live! Nice work!
If you have any issues, make sure to check there's no domain or path specific configurations within ~public_html. The following files commonly have domain or path specific configurations: