Home » My Mind » VPS » [Complete Guide] Transfer a WordPress Site from Shared Hosting to VPS Hosting

[Complete Guide] Transfer a WordPress Site from Shared Hosting to VPS Hosting

No need to scratch your head, I have worked with VPS for a very long time — I am sure this guide will fix all your problems. I will be using Cloudpanel to add wordpress site, you can also add multiple wordpress sites there very easily.

Things I have used in this guide:

Hosting: KVM2 Plan (Hostinger)

OS: Ubuntu 24.04

Panel: CloudPanel

This guide consists of 11 steps:

  1. Make the website’s backup copy of Files and Database (in Shared/Business Web Hosting)
  2. Delete the website
  3. Setup your vps environment (in VPS Hosting)
  4. Setup the cloudpanel
  5. Add a new wordpress site in Cloudpanel
  6. Make dns connection
  7. Add a ssl
  8. Now your WordPress Sample Website will show
  9. Upload files
  10. Upload database
  11. Make connection with database

1. Backup Your Files & Database of Website (In Shared/Business Web Hosting)

Now It’s time to login into Shared/Business Hosting

click on “manage”

go to files > Backups

Take Backups of File

  • click on Generate a new backup (Here, you will see an option to create a full backup of your website.)
  • Wait for the backup process to complete. Wait until it’s ready.
  • Download the backup

Note: It’s gonna take few minutes.

Take Backup of Database

To take backup of database, first be sure which database is your website’s real database.

to do so, go to Files > File Manager > Access Files of Mysite.com > public_html > wp_config.php (open this file)

Now scroll down a little bit, you will find DATABASE_NAME

For Example:

define( ‘DB_NAME’, ‘u738723dsjhswedsd’ );

“u738723dsjhswedsd” Now this is your database name. Now Take Backup of This Database Name.

go back to Files > Backups > Databases

and do Database Backup of it.

For Files (Alternatively)

Alternatively, you can also manually back up your files:

  • Go to Files > File Manager in your Hostinger hPanel.
  • Navigate to the directory where your WordPress files are stored (usually public_html).
  • Select all files and compress them into a .zip file.
  • Download the compressed .zip file to your local machine.

For Database (Alternatively)

  • In hPanel, go to Databases > phpMyAdmin.
  • Select the WordPress database you want to back up (this is usually named after your website).
  • Once inside the database, click on the Export tab at the top of the page.
  • Choose the Quick export method and make sure the format is set to SQL.
  • Click on the Go button. This will download an .sql file of your database to your computer.

2. Delete the Website

Open Dashboard of your Shared/ Business Web Hosting, go to Websites section > Click on three dots

Now click on Delete

It will show you the following popup, simply click on tick button and Click Delete.

Your website has been successfully deleted from the Shared/ Business Web Hosting.

3. Setup Your VPS Environment (In VPS Hosting)

Step 1: Access Your VPS Control Panel

  1. Log in to your Hostinger account.
  2. From the dashboard, navigate to the VPS section.
  3. Click “Manage” on your VPS plan to access the control panel.

Step 2: Choose your desired Operating System + Panel

This is typically the first step in setting up your VPS.

For operating system, I have choosed Ubuntu 24.04, we can also choose other OS like CentOS, AlmaLinux, etc.

For Panel, I have choosed CloudPanel, we can consider other Panels also.

4. Setup the CloudPanel

Login into the Hostinger VPS, go to VPS section > then click on Manage

Now go to panel access

Open this link

<add some information here—–how to reset password for adding a new password———->

5. Add a New WordPress Site in CloudPanel

login into the cloudpanel

Now add a site

click on create a wordpress site

Now it will look like this. Fill these below data (if you feel lazy to add password, just click on generate new password)

Now click on “create”

Hurray! Your WordPress Site Details has been successfully created

Now copy these details in a notepad or any text editor like MS-Word or Google Docs.

Click on “Back to Sites”

Your cloudpanel dashboard will look like this 🙂

Now click on ‘Manage’

Now your site’s dashboard will loook this:

6. Make DNS Connection

Copy your vps ip from cloudpanel dashboard: just click on that vps ip, it will copied automatically.

Now

Open your domain registarar (Namecheap in my case), add two A records there pointing to VPS ip.

OR

If you have cloudflare connected to the Namecheap then, there is no need to change the 2 A records in Namecheap, you will have to add 2 A records in cloudflare.

7. Add a SSL

Make sure your domain is pointed to the vps hosting, then do this step.

Inside Cloudpanel Website’s Dashboard, go to SSL/TLS Section > Actions > New Let’s Encrypt Certificate

Then click on ‘Create and Install’

If you are not using cloudflare, then installation will be done successfully.

But if you are using cloudflare, you may get the following error.

Error: “Domain could not be validated, urn:ietf:params:[something]:error:unauthorized “, it means Your Cloudflare is providing SSL to your website.

Now to fix this problem, open your Clouflare Dashboard, go to SSL/TLS section > click on Configure

Now it will look like this

Listen Carefully, if the option is left default in Full, then change it to Flexible — check your website now, if it works, its successful.

If it doesn’t work, change it to Full (Strict) — check you website now, it will be 100% successful now.

8. A WordPress Sample will show on Website

Go to https://yoursite.com, it will now show a sample wordpress site.

We will learn about uploading the Files and Databases — then show our own wordpress site.

Note: If you get this error saying to “Install WordPress”, then simply fill out the information and install it.

9. Upload Files

Go to Cloudpanel dashboard > File Manager section

Click on Add New > then click on Upload file

The file will be uploaded like this

Extract the file by right mouse clicking on it. Then click Extract.

Your extracted folder will look like this:

Open the file > go inside public_html folder

Select all by pressing Ctrl + A and then click Cut

After that, Click on Files, you will get to root folder (that is File Manager section)

Now Go to htdocs > www.[mysite].com

  • Select all and delete them
  • Then Right Mouse Click and Paste the files

10. Upload Database

Go to Cloudpanel dashboard > Databases

Scroll down a little bit

Click on Manage, it will open phpmyadmin panel

Click on Databases

Click on your Database

Scroll down a little bit, click on Check all, then select Drop

Now click on Yes

Now click on Import Tab > Click on Choose file

Scroll down after choosing the file — Now click on Import

You will get a message “Your data has been successfully imported”.

If you want to a add a new database, not use the already given database, then follow these steps:

Go to Cloudpanel dashboard > Databases > Add Database

You will get this, now add the database’s name, username, and user password. Store these details safely in notepad or any text editor, it will be useful later.

Click on Add Database

And Do the steps above mentioned.

11. Make Connection with Database

After doing above steps, you will get this error saying “Error establishing a database connection”.

Go to Cloudpanel dashboard > File Manager > htdocs > www.mysite.com > wp-config.php (open this file)

Now put the Details of Database’s Name, User, and Password which you had stored safely.

Hurray! Your website is live now!

Celebrate this Great Moment : )