Content Management Systems such as Joomla and Wordpress consist of three main components. The first component consists of the website Files which are located in a folder called public_html. The second component is a website database which holds additional information. The third component is the custom website emails which are located in a separate folder. In this article, we will review how to manually migrate an existing Cpanel Shared Hosting Joomla website to a secure Hestia Control Panel VPS.
This method consists of 12 steps:
#1 Set up a Canhost account and pay for a VPS-Express-1 Self Managed Cloud Server currently $18 per month with 4 GB RAM, 2 CPU, 20 GB SSD storage. This is enough space to run up to about 10 Joomla websites. https://www.canhost.ca/vps-hosting/
#2 Transfer all of your domain names to Canhost so you can manage their DNS Records directly from your Canhost account.
#3 Install a Debian server with the name ns1 into your Canhost VPS. SSH into the Debian server and change the etc/host file to your fully qualified domain name (aka ns1.myprimarywebsite.com).
#4 Install Hestia to your VPS with update, upgrade and then two commands from the hestiacp.com home page. Add --clamav no to the end of the second command prevent installing clamav. This will save you 1 GB of RAM.
#5 Log into your Cpanel account and copy the domain related emails from the old Cpanel server to your home computer – but do not copy them to the Hestia server (We will set up a new Hestia domain related email account).
#6 Copy the files from the Cpanel server to your home computer.
#7 Copy the database from the Cpanel server to your home computer.
#8 Log into your Hestia Admin Control panel and create a new user. Then log into the new user panel and create a new website with the same domain name as your existing Cpanel website. Check the email box if you want email but do not check the DNS box.
#9 Copy the files from your home computer to the new Hestia website.
#10 Copy the database from your home computer to the new Hestia website.
#11 Create new DNS records using the Canhost DNS Manager to point the domain name to the new Hestia VPS IP address.
#12 Use Hestia to add a Lets Encrypt SSL certificate to your new domain name.
Note: Below we will review some of these 12 steps. There is also a Hestia command line script that can can be used to migrate a website from Cpanel to Hestia. However, the manual method only takes a few minutes and is less subject to human error. We therefore recommend that novices stick with the manual migration method.
While this process focuses mainly on transferring content, it is also important after the migration is complete, to carefully change the DNS settings from the old shared server IP address to the new server VPS IP address. While we have covered the DNS IP address set up before, we will provide a reminder summary at the end of this article.
Practice First! Before you try to migrate a major live website with a lot of content, it is useful to create a Hestia Control Panel on a practice server and transfer a website with only a little content to the practice VPS. Here is the website we will use for our practice transfer: createyourownlinuxserver.com
These steps assume you have already set up Hestia on a practice VPS or on your real Canhost VPS.
Step 6: Create a Compressed Copy of your website
The actual transfer begins with copying your website Files from cPanel. Log in to cPanel and open the File manager.
Open the public_html folder. Click Select All to select all of the files and folders.
Then click Compress to create a copy of the files and compress them into a zipped file. This screen will appear.
Choose Zip Archive. Then click Compress Files. Then click Close. Scroll down to the well-known.zip file. Select it and download it.
Step 7 Copy the website database
Next, we export the website database. Open phpMyAdmin, which is under Databases in the cPanel menu.
Select the database in the sidebar. There should only be two options and it is the option other than information_schema:
Then click Export. This screen will appear:
Leave it set for Quick export. Then click Go. Note that export only exports a copy of the original database. It does not delete it. Save the file to your home computer downloads folder. Then close cPanel. We are now ready to upload your website content to your Hestia Control Panel and VPS.
Step 9: Upload Files to a new Hestia User Account
Log into your Hestia Admin panel and create a new user. For example, call the new user course1.
Then add an email address and password and click Save and Back. Then log out of the Admin panel.
Then log into your new user account and click Add New Domain. Use the same domain name as the original website. For example, createyourownlinuxserver.com. Leave the IP address set for the practice server IP address. Check the DNS zone and Enable mail boxes.
Then click Save. Then click Back. We will not get an SSL certificate for this domain until after we have set up the new DNS settings. This created the website, the DNS zone and the mail domain. But not the database.
So click DB. The click Add Database. The User Prefix will be automatically added to the beginning of the database name and username. So if your username is course1 and you type db1 into the Database box, the name will be course1_db1. If you type un2 into the Username box, the username will be course1_un1. The database password must have 8 characters including upper and lower case letters and at least one number. Course1_pw1.
Send login credentials to a ProtonMail account to protect them from hackers. Then click Save. Now go the web page and click the up arrow to confirm the default website appears:
Next, click Files and go to the web, yourwebsitename, public_html folder. Then click Add Files and upload your well-known.zip file into this new domain root directory. Hestia automatically uploads using SFTP.
Then click on the three dots to the right of the zipped file and click Unzip. Hestia will unzip the zipped file into the public_html root folder.
Step 10: Upload your database
Click Exit to Control Panel to leave the Hestia File Manager. Click DB to go to the Databases screen. Then click Open phpMyAdmin to log in to the database edit screen. Type in the username and password of the Hestia database you just created.
Then click Go. Once logged into the new Hestia database, select the course1_db1 database in the upper left corner and click Import in the top menu:
You will now see the Import screen.
Click Browse and navigate to the old Cpanel SQL database file to select it. Then click Open. Then scroll down the page and click Go to upload the old database into the new database. Your database will be successfully restored. Log out of phpMyAdmin by clicking on the log out button in the upper left corner of the screen.
Connect your new database to your Hestia website
Your database is restored but it’s still not connected to your Hestia website This is because in cPanel, your database name might be ‘cpanel_database’. But in Hestia, it might be ‘hestia_database’. To connect your new website to your new database, you have to tell your website the name of the new database, its new username,and updated password. First, you will have to locate the configuration file where database login details are defined.
Click on Files to open the Hestia File Manager. Then go to the public_html folder and scroll down to configuration.php
Click on this file to open it. To update the database information, scroll to line 16 17 and 18. Here are the current entries:
public $user = 'createyourownlin_00';
public $password = 'u53p5S5)S@';
public $db = 'createyourownlin_00';
Edit these three lines to replace old database details with the details of the database you just created.
public $user = 'Database username goes here';
public $password = 'Database password goes here';
public $db = 'Your database name goes here';
Here are my new values:
public $user = 'course1_un1';
public $password = 'Course1_pw1';
public $db = 'course1_db1';
Some of the paths also need to be changed.
Scroll down the page to lines 59 and 60 to change:
public $log_path = '/home/createyourownlin/public_html/administrator/logs';
public $tmp_path = '/home/createyourownlin/public_html/tmp';
Change these paths to:
Then click Save and Close. Then change the name of index.html to old-index.html. Then delete the well-known.zip file. Then Exit to Control Panel.
#11 Create new DNS records
We will use the Canhost DNS Manager to point the domain name to the new Hestia VPS IP address. In my case, the practice server IP address is 126.96.36.199 and the website name is createyourownlinuxserver.com. This website is still live and being routed through the normal Canhost DNS server. To change this website from the Fullhost DNS server to your Practice Server Vanity DNS server (ns1.localdevtest.com), log into your Canhost account and click on Domains, My Domains. This will open a table showing all of your domain names. To the right of your domain name, click on the small down arrow and click Manage Nameservers.
Click Use Custom Nameservers. Then type in the name of your Hestia VPS nameservers:
Then click Change Name Servers. Assuming that you have properly set the Zone Records for the nameservers, ns.localdevtest.com in the CanHost DNS Manager, your website will now point to the IP address associated with your custom nameservers. However, it may take a few hours for the Internet to update this new route to your website. In the meantime, log out of your CanHost account. Then open a new web browser and visit your website to see if it is still up:
It is still up. But it is likely still using the old Cpanel shared hosting servers. Clear the browser cache. Then refresh the web browser page. This will send a new request to the global DNS system. Sadly, your website can no longer be located!
You can check the status of your DNS records propagation by using any global DNS checker such as
Type in just your domain name and click Search. Red Xs indicate that your domain name has not propagated. Green check marks indicate it has propagated. Sadly, no matter how long you wait, the website will not propagate. The problem is that the old database includes an old Cpanel SSL certificate that will not work with Hestia. Therefore, after installing the old database, we need to use Hestia to create a new SSL certificate to replace the old Cpanel certificate. If you skip this step, you will likely get a “Too many redirects” error which will prevent your web page from loading.
#12 Use Hestia to add a Lets Encrypt SSL certificate.
After loading the new Database, and changing the name servers to your custom Hestia Name Servers, we need to use Hestia to get a new SSL Certificate. Log into your Hestia User panel. Select the domain name and edit it. Check Enable SSL for this domain. Then check Use Lets Encrypt.
Then click Save. Wait for the Certificate to Install. It ended with Changes have been saved – meaning that the new SSL certificate was installed and the old Cpanel SSL certificate was removed. Then click Back. Then open a new browser. Clear the cache and visit the website. https://createyourownlinuxserver.com/
Success! I know this is my new website because after I created the well-known.zip file, I deleted the header image using the file manager in the old cpanel. Now log into your Joomla website control panel and see if we can update extensions and Joomla version. From the Joomla Control Panel, click Extensions, View Updates. The JCE Editor updated without an error. However, BF Stop had this error:
An error has occurred. 1146 Table 'course1_db1.#__bfstop_whitelist' doesn't exist
Click the back arrow to go back to the Joomla Control Panel. BF stop extension did update anyway. Then click on the Joomla Update Now button. Click Install the Update. Joomla updated successfully. Finally, go to Content, Media and upload a new header image.
Log out of the Joomla Control Panel and close the browser. Also log out of the Hestia User panel and close the browser. We are done migrating this website from Cpanel to Hestia.
You can see that the migration process of moving a website from a Cpanel shared hosting account to a Hestia VPS User account is complex with lots of ways to go wrong. Even if you successfully migrate the old website to the new VPS account, you are still left with a Joomla 3.9 website – which will later need to be updated to a Joomla 4 website – another complex process. Finally, because the Cpanel shared hosting account is not very secure, there is always the chance that hackers have already buried themselves deep into your Joomla 3.9 website files. When you migrate your Joomla 3.9 website files to your new VPS, you may be bringing the hackers along with these old files.
Therefore, since Joomla 4 recently came out, a better alternative in the long run is to simply install a new Joomla 4 website on your Hestia User account. Then move only the Joomla 3.9 images folder from the old website files to the new Joomla 4 website. Then exactly recreate the Joomla categories. Then copy and paste the Joomla articles one by one. Then recreate the Joomla menu items one by one. Then recreate the Joomla modules one by one. If your website has a lot of content, this will also be a time consuming process. But it will end with having a clean and reliable Joomla 4 website with a clean and well structured database.
In the next article, we will therefore explain how to add a Joomla 4 website to a new Hestia User account as the first step in this alternate website migration process.