cPanel - Guide e configurazione search
clear

How to transfer a website

When you decide to transfer a website from a provider to another you're usually looking for new solutions in terms of services, especially hosting, for your business online. To complete the process successfully, you have to follow several rules to make your website "survive" the migration with no damage for its own integrity.

The first step you have to take is saving all the essential components of the site itself, such as database (usually MySQL) and all the files and folders included in the web space. Then you can transfer your website and check that the DNS are correctly configured.

The procedure to transfer a website depends on the type of website you want to migrate. A website can be a static or a dynamic website.

To transfer a static website, download every single page with a dedicated software (such as SiteSucker, in case you use a Mac device, Httrack in case you use Windows or wget if you use Linux), take all the files copied in HTML/CSS from your laptop and transfer them, using a FTP client, on the new provider's server, using the credentials provided as you purchased your order. Then, configure the website's DNS to make them point to the new records provided by your new provider.

If you need to transfer a dynamic website, the procedure may take a little bit longer. First, you have to download locally all files (PHP, CSS, HTML, JS, etc.) and then log-in to your database and make a dump. This procedure, in case of a MySQL database, consists in the generation of a text file from the PHPMyAdmin software.

Database is the most important part of a dynamic website. To make a copy or a dump you have to log-in to your cPanel control panel and click on the PHPMyAdmin icon. As you open the database management app, you will see all the tables composing it. Here, select the one used by your website and click on "Export",  in the menu above.

Then, click on "Execute", after selecting the option "Quick-display only the minimal options" and in the following box "SQL".

 

By clicking, you will download the chosen dump with .SQL extension or ZIP extension that you have to import on your new provider. Now, close your old provider PHPMyAdmin and access to the new provider's PHPMyAdmin. We remind you to follow the instructions provided by your new provider via e-mail during the registration process.

To allocate the database space on the new provider using cPanel, click on "Database MySQL" in the "Database" table. In the dedicated field, type your database name and then click on "Create Database". Then, create an authorized user to the database and associate it to the database itself.

We remind you that after the transfer procedure, the database access data (such as code, username and password) inside the CMS configuration file may not be the same of the original ones anymore. If there's no match, the website will not be able to work. To view all the pages of your website correctly on the new provider, the parameters of the connection via PHP code must be coherent with the new ones. You have to edit, on the new provider's filesystem, the configuration file with the following connection parameters:

  1. username = old provider username
  2. password = old provider password
  3. hostname = old provider host
  4. database = old provider database


Now, type your database name next to the "Create new database" box, confirm the operation and wait for the page to be uploaded.

To restore your database, log-in to PHPMyAdmin again, click on "Import" and then on "Browse". Select the dump file, confirm by clicking on "Execute" and check that the database has been successfully imported.

When you create the users you will have to take note of all the informations related to their usernames (new provider username) and passwords (that is usually automatically generated by the system for security matters, new provider password).


In the end, you will have on one side the old users and on the other one the new ones:

username = old provider username username = new provider username
password = old provider password password = new provider password
hostname = old provider host hostname = new provider host
database = old provider database database =  new provider database


The configuration file on the new provider will be:

define(‘DB_NAME’, ‘databasenuovoprovider’);
define(‘DB_USER’, ‘usernamenuovoprovider’);
define(‘DB_PASSWORD’, ‘passwordnuovoprovider’);
define(‘DB_HOST’, ‘hostnuovoprovider’);
non così (come era nel file originale prima del trasferimento):
define(‘DB_NAME’, ‘databasevecchioprovider’);
define(‘DB_USER’, ‘usernamevecchioprovider’);
define(‘DB_PASSWORD’, ‘passwordvecchioprovider’);
define(‘DB_HOST’, ‘hostvecchioprovider’).


After updating the configuration file using FTP:

  1. Transfer all filesystem files from the old provider to the new one, using FTP;
  2. Transfer your database from the old provider to the new one, using PHPMyAdmin;
  3. Update the DNS coherently with the new provider's IP.


If the procedure is correct, the transfer will be successfully completed.
If you don't want to use the manual procedure, you can choose to use Keliweb free migration tool.

 

 

 

Did you find this answer helpful?

Still need help?

Contacts

Contacts

Request information, assistance or quotes

Chat

Chat

Ask about services and promotions

Ticket

Ticket

Submit a request for technical support

Payments

Payments

Make a payment in a few clicks