Migrating WordPress Site to New Host Using cPanel

Migrating a website from one host to another is a headache whether you know what to do or not. You may want to move your website to another host because it has grown too big over the years and has been receiving too much traffic lately that your present hosting service cannot handle. Whatever your reason is for the hosting transfer, the following steps will make it smooth and easy. This tutorial uses cPanel (versions 80.0.23 and 82.0.8) to accomplish the task.

1. Download the WordPress website
  1. Log in to the cPanel of your first web host.
  2. Go to File Manager.
  3. Navigate to your WordPress installation.
  4. Compress your WordPress installation.
  5. Download the compressed file.
  6. Make another copy of your downloaded compressed file in case something wrong happens during the migration process.
2. Export the WordPress database
  1. Go back to the cPanel of your first web host.
  2. Click on phpMyAdmin.
  3. A list of databases will be displayed on the left; select the database for the website that you downloaded.
  4. Click on Export.
  5. Click on the Go button (Quick export method and SQL format are the defaults. Just leave them as is.).
  6. Make another copy of your exported database file in case something wrong happens during the migration process.
3. Create a new database on the new host server

Refer to the tutorial How to Create a New MySQL Database Using cPanel.

4. Import the database
  1. Go to the cPanel of your second web host.
  2. Click on phpMyAdmin.
  3. Select your new database from the list on the left.
  4. Click on the Import tab.
  5. Under File to import, browse to your downloaded database from your first web host.
  6. Uncheck the checkbox under Partial import, see to it the format is set to SQL, and then click on the Go button.
  7. Wait for the import to finish.
5. Edit the wp-config.php file
  1. Extract your downloaded folder in Step 1.
  2. Open the wp-config.php file using a text editor.
  3. Look for the following lines and change their values to those of the values you typed in Step 3 (Please remember that shared hosting accounts usually have prefixes attached to these values.):
    * define('DB_NAME', 'db_name');
    * define('DB_USER', 'db_user');
    * define('DB_PASSWORD', 'db_pass');
  4. If you want to change your website’s database table prefix, you will also need to change the value for the following line:
    $table_prefix = 'wp_';
  5. Save the changes.
  6. Compress again the folder.
6. Upload the WordPress files to the new host
  1. Go back to the cPanel of your second web host.
  2. Scroll down to the Domains section and click on Domains under it.
  3. Click on Create a New Domain.
  4. Type in your domain name, un-tick the checkbox next to Share document root, and click on the Submit button.
  5. Go back to the cPanel main interface.
  6. Go to File Manager.
  7. Navigate to the folder for the domain name.
  8. Upload your compressed folder from Step 5.
  9. Extract the compressed file. This process can take some time depending on the size of your WordPress installation folder.
7. Change the domain’s DNS settings

Log in to your domain name service provider and make the necessary changes to the DNS settings of your domain name. DNS changes typically take between one to 48 hours to fully take effect.