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. Previously we have shown that Hestia combines all three of these components into a single Hestia User backup file which can then be easily transferred to another VPS. However, Cpanel requires these three components to be transferred separately. In this article, we will review how to manually migrate an existing Cpanel Shared Hosting Joomla website from Cpanel 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 to 20 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 IP and change the SSH configuration file to allow Root Log In. Then create a root password and SSH into your VPS IP as the root user and install Midnight Commander.
#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 as a single zipped folder from the Cpanel server to your home computer.
#7 Copy the database as a single file 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 and also check the DNS box.
#9 Copy the files from your home computer to the new Hestia website root folder using the Hestia File Manager.
#10 Copy the database from your home computer to the new Hestia website using the Hestia Database tool.
#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.
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.
These steps assume you have already set up Hestia on your 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 by clicking on the database link. There should only be two options and it is the option other than information_schema:
This will cause the database table structure to appear on the right side of the screen. 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 go to 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 Canhost VPS 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 9 addition: Transfer Large Files with Midnight Commander
The file sizes of my Joomla websites range from 100MB to 300MB with an average of about 200MB. These zipped files can easily be transferred from one website to another via the Hestia File Manager Add File button which has a limit of 1GB. However, some websites have huge amounts of content which may include videos. Thus, these websites may have a file size of more than 1 GB and even more than 2 GB. These zipped files are too large to be transferred by the Hestia File Manager. One could increase the file size upload limit. However, this would be a security risk. We will therefore explain how to transfer large zipped files in Step 9 using Midnight Commander.
Step 9.1: Create Two Demo Zipped Files
Right click on any folder. Then click Properties. This will tell you the file size for all of the files in each folder. Find a folder just under 1GB and another just under 2 GB. Then copy each folder. Then rename each copied folder. Joomla zipped files extracted from Cpanel as part of moving a website from Cpanel to Hestia will have the file name well-known.zip and the well-known folder is the first folder in the public_html folder. Wordpress files extracted from Cpanel will likely have the name includes.zip as the includes folder is the first folder in Wordpress. We will name our first zipped file well-known.zip which is 900 MB and our second zipped file we will name well-known2.zip. It is 1.6 GB.
Step 9.2 Create a Fake Sub-Domain and use it to test file transfers
Log into your Hestia Admin account and go to a User account. Then click Add Web Domain and create a new website. We will create the fake website called demo6.createasecurewebsite.com. It does not need DNS or email. Just click Save. Then click on your File Manager for this User. Click web. Then click on your fake domain name. Then click public_html. Then click Add Files and select your well-known.zip file. This will take several minutes to upload. It may claim to be done before it is actually done. When it is actually done, it will look like this:
Click X to close the transfer progress bar. Then right click on the thee dots to delete the well-known.zip file. Then click Add Files again and this time add the well-known2.zip 1.6 GB file. This warning will immediately appear:
By default, the Hestia File Manager can only upload files smaller than 1 GB. You could split your big file into two smaller files. But this risks make an error and losing important data. Close the Hestia User File Manager clicking Exit to Control Panel. We will use Midnight Commander to load the big file.
Step 9.3: Install Midnight Commander on your Home Computer
You can install Midnight Commander with the Debian Software Center.
Step 9.4: Open Midnight Commander on your Home Computer
Open your home computer terminal. Then type mc and press Enter.
The terminal opens with your Home computer user files shown on both the left and right panels.
Step 9.5: Start an SFTP Session.
SFTP is much more secure than the traditional file transfer process called FTP. Click on the word Right to open the Right panel. Then click SFTP Link to open this popup:
Enter sftp://root@yourIP>
In my case, it was sftp:
Then click OK. Then enter your Root User SSH password you used in your SSH session to install Hestia to this server. This will change the files on the right panel to the files on your VPS server.
Step 9.6 Navigate to your Fake Website Public Folder
In the right panel, click Home. Then click on the user account you used to create the fake domain name. Then click web. Then click on the fake domain name. Then click on public_html.
It now shows the default two files in the public_html folder for our fake domain name.
Step 9.7 Upload your large zipped file to this folder.
In the left panel, click on the well-known2.zip folder to select it. Then to the right of the word Left, click File, Move or Copy. This will bring up this popup:
The file to transfer and the path have already been correctly set. Just click OK to being the transfer process.
Note that Midnight Commander estimates that this process will take 31 minutes and 30 seconds. Feel free to do something else while you are waiting. But do not close your terminal, or Midnight Commander or the transfer progress popup. When the transfer ends, the right side will look like this:
Go back to the Hestia User Control Panel and click Files to open the File Manager again. Here is the public_html file for our fake website.
Thus, it is possible to upload a file greater than 1 GB to your website public folder. But it must be done by Midnight Commander. In your Hestia File manager, click on the three dots to the right of this file and click Delete. Then click Exit to Control Panel. Then select the fake website and delete it.
Then close the User Control Panel and close the Admin Control Panel and close the web browser. In Midnight Commander, type exit into the prompt line. Then press Enter. This will close the SFTP session without shutting down the server. Then close the Home terminal.
Step 10: Upload your database
Click Exit to Control Panel to leave the Hestia File Manager and return to the Hestia User Control Panel. Before we import the database, we need to change some of the Hestia Server settings to allow more time for the database to import.
Open a terminal on your home computer and start a root SSH session with ssh
Then type mc to open Midnight Commander. Press Enter to open the root folder. Then scroll up to the etc folder to open it. Then scroll down to the php folder to open it. Then open 7.4 folder. Then open the fpm folder. Then select the PHP INI file and click File Edit. Type Alt plus c to display the line numbers. Then use the down arrow to scroll down to line 388. Change the max_execution_time from 30 (seconds) to 300 (seconds).
Then scroll down to line 874. Change default_socket_timeout from 60 (seconds) to 300 (seconds). Then click Control plus o followed by Enter to save the file. Then click Control plus X to close the file. Then type exit to exit Midnight Commander. Then type exit to exit the SSH session.
Once the Hestia server settings are improved, go back to the Hestia User Control Panel and click on the up arrow in the upper right corner of the screen to go back to the Hestia Admin Control Panel. Then click on the Server settings wheel. Then select php7.4-fpm and click on the restart icon. This will save the changes to the PHP dot INI file.
Then click on Users and select the user and click on the right arrow to return to the Hestia User Control Panel. Then 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:
/home/course1/web/createyourownlinuxserver.com/public_html/administrator/logs
/home/course1//web/createyourownlinuxserver.com/public_html/tmp
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 this example, the Canhost VPS server IP address is 49.12.64.231 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 previous Cpanel DNS server to your Canhost VPS 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.
Change Canhost DNS Zone Records for your Domain Name
Assuming you are using Canhost to host your domain names, your domain name is currently pointing at the Canhost IP addresses. We want the domain name to point at our Canhost VPS Hestia server IP address which is 66.209.xxx.xxx. While still in your Canhost account, click on Client Area to return to the main screen. Then click My DNS in the side menu. Then scroll down to your domain name and click on the Edit pencil to the right of your domain name to edit your domain name zone records. You will see four A records at the top of the list with each pointing to the CanHost IP address. Delete each of these and change the IP addresses to the IP address of your Hestia Server. Then click SAVE at the bottom of the screen. Then click Add Record. Use the Type drop down arrow to choose CAA.
Then type your domain name such as mywebsite.com into the Name box. Type the number 0 into the Flag box and the word issue into the Tag box. Then type the domain name letsencrypt.org into the Target box. Then click Add Record. Then click Add Record again and create a second CAA record with the Tag issuewild. Then click Save at the bottom of the DNS Zone Records table to save these changes. Then log out of your Canhost account.
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, open a new web browser and visit your website to see if it is still up:
https://createyourownlinuxserver.com/
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. 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. 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.
#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! 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.
What’s Next?
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.