How to Migrate Your Website from VPS to Web Hosting on Hostinger

Two simple ways how to migrate from VPS to a Web Hosting on Hostinger

Updated 4 weeks ago

Migrating your website from a VPS plan to Web Hosting on Hostinger is a straightforward process. This guide will walk you through each step to ensure a smooth transition.

Step 1: Prepare for Migration

Before you start the migration process, make sure to:

  • Check resource requirements to ensure that your website can perform optimally on a Web Hosting plan.

  • Review limitations of Web Hosting to confirm compatibility (e.g., software compatibility, resource limits).

Note: VPS offers full control and flexibility, while Web Hosting may have restrictions on certain scripts and resource-intensive applications.

Step 2: Download Files and Databases from VPS

  1. Connect to Your VPS via SSH:
    in your terminal enter this command, with your VPS IP address.

    ssh root@your-ip-address​

  2. Find Your Website Directory:
    To locate your directory, use this command:

    ​find / -type d -name "your_website_directory"​

  3. Compress Your Website Files:
    Compress all website files into a .zip file:

    ​zip -r file_name.zip path/to/your/directory

    Note: If you see zip: command not found, install zip with:

    ​sudo apt-get install zip​

  4. Download the Compressed File to Your Local Device:
    Run this command on your local machine’s terminal (not on the VPS), changing your_vps_ip with your actual IP:

    ​scp root@your_vps_ip:/path/to/file_name.zip /local/path/​

  5. Export Your Database:
    Create a backup of your database:

    ​mysqldump -u root -p database_name > backup_name.sql

    You will be prompted to enter your password, you should enter your mysql password for the specified user.

    Note: While you are entering the password, it will seem that nothing is being typed in the terminal. It’s a common security practice.

  6. Download the Database Backup:
    Again, on your local machine’s terminal (not on the VPS), run:

    ​scp root@your_vps_ip:/path/to/backup_name.sql /local/path/​

OPTION A:

Step 3: Set Up Your Web Hosting Environment

  1. Log in to hPanel and open your Web Hosting plan.

  2. Press on “Add website” -> “Migrate Website”

    Hostinger panel showing Add website menu with Migrate Website option

  3. Upload your website backup files (don’t forget the database file)

    Hostinger website migration upload backup files step with Upload button and progress bar at 45%

Step 4: Final Checks

  1. Monitor your website’s performance to ensure it’s stable on Web Hosting.

  2. If everything looks good, you’re all set!

OPTION B:

Step 3: Set Up Your Web Hosting Environment

  1. Log in to hPanel and open your Web Hosting plan.

  2. Go to File Manager and upload your website files to the /public_html directory.

    Hostinger dashboard with File manager and Databases highlighted in the main panel

  3. Create a new database for your website by going to Databases in the side menu, then Management, then by creating new database name, username and password.

    Hostinger databases management page with Management selected in the sidebar

  4. Import your database:

  • Go to phpMyAdmin in hPanel.

  • Select your newly created database and import the .sql file from your local device.

    phpMyAdmin import page with file upload field highlighted

Step 4: Update Configuration Files

Edit your configuration file (e.g., wp-config.php for WordPress or config.php for other CMSs) to reflect the new database details:

Update database name, username, and password with the one’s created in hPanel.

Step 5: Final Checks

  1. Monitor your website’s performance to ensure it’s stable on Web Hosting.

  2. If everything looks good, you’re all set!