×

How to transfer a website from one hosting to another?

Transferring a website might seem like a complicated task, but with the correct steps, the process becomes much simpler. This technical guide will help you migrate a website from one hosting provider to another, focusing on using cPanel on the new server and transferring files via FileZilla.

Preparing for Migration
Before starting the transfer, ensure you have all the necessary information at hand and have completed a full backup.

Full Backup of the Current Website
This is a crucial step. A full backup includes all website files and the database.

  • Website Files: Connect to your old hosting account (via cPanel, a different control panel, or FTP) and download all files and folders from the main site directory (usually public_html).
  • Database: If your website uses a database (most commonly MySQL), you will need to export it. Most control panels offer access to phpMyAdmin, from where you can export the database in .sql format.

Required Information
Ensure you have the following details for the new hosting:

  • cPanel Connection Details: Username, password, and cPanel URL for the new hosting server.
  • FTP Connection Details: Host (server), username, password, and port (usually 21). These are needed for FileZilla.
  • Database Details (for dynamic websites): Database name, username, and password.

2. Creating the Infrastructure on the New Hosting
Adding the Domain
If you haven't already, add your domain to the new hosting account. In cPanel, go to Domains and click on Create A New Domain, then follow the steps to add the domain. This will create a dedicated directory for your website. If you encounter difficulties, you can consult our article on the topic "How to connect a domain to hosting?"

Creating the Database and User (for dynamic websites)
For websites that require a MySQL database, you will need to create a new database and an associated user in cPanel.

  1. Access Manage My Databases from cPanel.
    cPanel My Databases
  2. Create a new database in the Create New Database section (note the name).
    cPanel Create New Database
  3. Create a new user in the Add New User section for the database (note the username and password).
    cPanel Add a New User
  4. Add the user to the database in the Add User To Database section and grant it all privileges.
    cPanel Add User to Database

3. Transferring Files via FileZilla
FileZilla is a free and open-source FTP client, ideal for transferring files between your computer and the hosting server.

  1. Download and Install FileZilla: If you don't already have it, you can download it from the official FileZilla website.
  2. Connect to the New Server:
    • Open FileZilla.
    • At the top, you will see the Host, Username, Password, and Port fields.
    • Enter the FTP details of your new hosting and click Quickconnect.
      FileZilla Input Values
  3. Transferring Files:

    • In the left panel (Local site), navigate to the directory on your computer where you saved the website files (the backup).
    • In the right panel (Remote site), navigate to the root directory of your domain on the new server (usually public_html or the specific directory created for your domain).
    • Select all files and folders from the left panel and drag them to the right panel to initiate the transfer. This process may take time depending on the size of the website and your internet connection speed.

4. Importing the Database (for dynamic websites)
After creating the empty database, it's time to import the .sql backup of the database.

  1. Access phpMyAdmin from cPanel.
    cPanel phpMyAdmin Button
  2. Click on the Import tab.
  3. Select the database you created earlier.
  4. Choose the .sql file you exported from the old hosting and click Go.
    phpMyAdmin Import Database

5. Updating Configuration Files
This step is essential for dynamic websites, as they need to know where to find the new database.

  • Locate your website's configuration file. For WordPress, this is wp-config.php.
  • Open this file (via File Manager in cPanel).
  • Look for the lines that define the database name, username, and password. Update these values with the details of the new database created on the new hosting.

Example for wp-config.php (WordPress):
define( 'DB_NAME', 'new_database_name' );
define( 'DB_USER', 'new_db_user' );
define( 'DB_PASSWORD', 'new_db_password' );
define( 'DB_HOST', 'localhost' ); // Usually, 'localhost'

 

6. Updating Nameservers
This is the final step to direct visitors to your new hosting.

  1. Connect to your domain registrar's control panel (the place where you purchased the domain).
    clientarea domains
  2. Look for the Nameservers or DNS management section.
    clientarea manage ns
  3. Replace the old nameservers with those provided by your new hosting provider. For IPHost, these are dns1.innovahosting.net and dns2.innovahosting.net.
    clientarea IPHost nameservers

Note that DNS propagation (the time it takes for nameserver changes to propagate globally) can take between 24 and 48 hours. During this time, your website may be accessible from either the old or the new server.

If you prefer not to take any risks in the process of transferring your website from one hosting provider to IPHost and you already have a hosting service purchased from us, you can always open a ticket to the IPHost technical department.

All you need to do is mention the access details for the server from which the transfer is being made in the ticket. The technical team will handle the complete migration, ensuring everything runs quickly and smoothly. This option is ideal for ensuring your website is transferred securely, without any hassle on your part.