PHPMatters Help You Better Hosting Your PHP-based Sites
How to Migrate Drupal Site to a New Hosting in A Safe and Secure Way

How to Migrate Drupal Site to a New Hosting in A Safe and Secure Way

It might be happening that you want to change your existing host to a new company. The reasons can be various, but there is one certainty that you have to migrate your website to that new hosting provider whatever publishing tool or CMS you are using. Unlike installing Drupal that is easy, the migration process needs great care. In the following, we have come out a detailed tutorial concerning about how to migrate Drupal site to a new hosting, without losing all the features and functionalities included in the website.

Basic Preparations

PreparationsTransferring a Drupal website to a new server is not a different take, but before migrating, you have to do a lot of preparation works to eliminate the possibilities of any unexpected situations. Note that the following to-do list is organized in the right order, so you’d better finish them one by one.

Check the New Hosting

Firstly, you have to make sure that the new hosting company selected is 100% Drupal compatible with all the features needed, offering a quality and reliable hosting service like BlueHost, HostMonster, or Arvixe. If you move from a good host to a less-good one, then things can stop working.

Update Drupal Core and Applications

The second preparation task is to check the version of Drupal core, modules, and theme used in your site, and to figure out whether they are up-to-date. If things residing on the website are not the latest version, you’d better update them before migration. This can make it easy to debug any problems.

Check PHP and MySQL Version

This step can help you ensure the proper work of your installed modules. After all, if the Drupal modules require PHP 5.x, but your hosting only allows PHP 4.x, then the compatibility issue might occur.

Back Up the Drupal Files

After finishing all the preparation jobs, now you need to back up your Drupal powered website, including non-core files and .htaccess file, etc.

The root directory or home directory stores all the files that make Drupal run, so you have to make a backup by downloading all the folders and files using your favorite FTP client like this one. Also, you can do this using the command line.

back up command line

Back Up and Export Databases

In addition to files, Drupal databases also need to be backed up. You can do this easily with the help of phpMyAdmin. This tool is a powerful and user-friendly for database management.

First of all, go into this tool from your control panel. Generally, you can find the icon under the Databases section. Then, select the name of your target database in the left-handed column.

migrate databases

In the next page, you can find the Export button on the navigation bar. Simply click it. Here, we highly suggest you to check the box before “Save as file”, and to choose the “gzipped” format for compression.

save as file

Import Database

Once done, you can create a new MySQL database with the MySQL user and password. You’d better use the same name as the one used in your old hosting.

Now, you need to import the MySQL database to your new hosting using phpMyAdmin. Log into the control panel offered by your new hosting provider and find the icon of phpMyAdmin under the Databases category. Then, click on the Import button that is placed on the top of the screen.

import database

Under this tab, there are several options available, and firstly, move your eyes into the Browse section. After finding the database file you have exported previously, you simply need to open and upload it. Remember to decide the format of the file to SQL. In terms of format-specific options, you can leave the settings in default.

After clicking the Go button for proceeding, you can see a message informing you that the import has been successfully finished.

Move Files

Now, you need to move the files with the complete Drupal installation to you new home directory using FTP client. Make sure that you haven’t lost any data, files, and folders needed.

Configure and Test the Site

testIn fact, you have already moved your Drupal site to a new hosting, but still, you need to do some configuring takes.

To configure the database correctly, you’d better double check the .htaccess file and settings.php file and move all the settings related to your old post. In addition, don’t forget to add your new domain information.

Now, you can log into your website to figure out whether it can run properly. For instance, you can check the site status at admin, reports, and status, create a new post, modify the old article, and check the settings of your modules.

If there is nothing abnormal, then you can run your site with a new hosting company successfully.