Learn how to migrate shared cPanel Hosting to a Vultr Cloud Server. Our Vultr Support team is here to help you with your questions and concerns.
How to Migrate Shared cPanel Hosting to a Vultr Cloud Server
Migrating a website from a shared hosting cPanel to a VPS server can enhance performance, flexibility, and security. But if you are hesitant to proceed without the right guidance, you are in luck!
This guide will walk you through the process, ensuring a smooth transition without data loss or downtime.
An Overview:
How to Migrate Your Website from cPanel to a VPS: A Step-by-Step Guide
1. Set Up FTP Access on the VPS Server
To transfer files from cPanel, we must enable FTP and create a user account.
- First, install vsFTPd on your server:
sudo apt-get install vsftpd
- Then, edit the vsFTPd configuration file:
sudo nano /etc/vsftpd.conf
Also, uncomment the following lines:local_enable=YES
write_enable=YES
anonymous_enable=NO
- Now, save and close the file.
- After that, create a local user account and grant sudo rights:
adduser example sudo
- Then, start the FTP server:
sudo service vsftpd start
- Open port 22 on the firewall:
sudo ufw allow 22/tcp
sudo firewall reload
2. Log in to cPanel
Depending on the hosting provider, log in to cPanel using:
https://example.com/cpanel
3. Backup cPanel
Create a full cPanel backup to preserve website files, emails, DNS records, and databases.
- In cPanel, navigate to Backup under the Files section.
- Then, under Backup Destination, select SCP.
- Enter the VPS server IP, FTP user, password, and port from Step 1.
- Once the backup is complete, log in to the VPS and locate the file:
tar -xvf backup-*_*_example.tar.gz
- Then, rename the extracted folder:
mv backup-__example/ cpanelfiles
- Change to the directory and list files:
cd cpanelfiles/
ls
Migration Option 1: Install a Web Stack to Host the Website
- First, we have to set up Apache, MySQL, and PHP
- Install Apache:
sudo apt install apache2
sudo systemctl enable apache2
sudo systemctl start apache2
- Install MySQL:
sudo apt install mysql-server
mysql_secure_installation
sudo systemctl enable mysql
sudo systemctl start mysql
- Install PHP:
sudo apt install php php-xml php-gd php-mysql php-curl php-zip php-mbstring
- Install Apache:
- Then, it is time to configure Apache:
- Create a virtual host file:
sudo nano /etc/apache2/sites-available/example.com.conf
- Then, add the following:
<VirtualHost *:80>
ServerAdmin user@example.com
ServerName example.com
DocumentRoot /var/www/example.com/
</VirtualHost> - Save and close the file.
- Then, enable the configuration and restart Apache:
sudo a2ensite example.com.conf
sudo systemctl restart apache2
- Create a virtual host file:
- Now, it is time to move the website files to VPS. So, copy files to the webroot directory:
sudo cp cpanelfiles/homedir/public_html/* /var/www/example.com
Then, grant ownership rights:sudo chown -R www-data:www-data /var/www/example.com
- Then, we have to restore databases. So, change to the MySQL directory:
cd /cpanelfiles/mysql
And, restore the database:
mysql -u root exampledb < file.sql
Then, verify the tables:
mysql> USE exampledb;
mysql7gt; SHOW TABLES;
After that, exit MySQL.
- Now, point the domain to the VPS by logging in to the VPS provider’s portal. Then, add a new domain and enter the server IP. Finally, update the nameservers in the domain registrar panel.
- Now, it is time to enable HTTPS. So, install Certbot:
sudo apt install python3-certbot-apache certbot
Then, request a free SSL certificate:sudo certbot -d example.com -m user@example.com
Migration Option 2: Migrate to a Free Control Panel
If we prefer a free control panel, Virtualmin allows importing cPanel backups.
- Log in to Virtualmin.
- Then, go to Add Servers > Migrate Virtual Server.
- Upload the cPanel backup file.
- Choose cPanel Backup as the backup type.
- Finally, click Migrate Now to import the data.
Migration Option 3: Migrate to Self-Hosted cPanel
If we are using cPanel on the VPS:
- Log in to WHM:
http://server-ip:2087
- Then, go to Transfers > Transfer and Restore a cPanel Account.
- Select the backup file from the server or upload it manually.
- Next, choose Replace All Matching A Records.
- Finally, click Restore to complete the migration.
Test the Migration
- Visit the domain:
http://example.com
- If DNS propagation isn’t complete, it may take 3-12 hours.
- Test HTTPS:
https://example.com
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
Migrating cPanel to a VPS server ensures better performance and security. By following our guide, you can seamlessly transfer your website, restore databases, and configure a secure hosting environment.
In brief, our Support Experts demonstrated how to migrate shared cPanel Hosting to a Vultr Cloud Server.
0 Comments