Clicky

How to migrate Drupal site to hosting?


All right, to migrate the Drupal site to a modern hosting, you must to transfer files and database of this web-site.
To do this, you can use:
  • On the server - administrator rights, MySQL, PHP and Linux/Windows Apache.
  • On the hosting - control panel or access by SSH.

Creating a database dump

Dump - is the contents of the database. Before creating a dump, you need to clear the Drupal cache.
For this:
   • Log in to the admin panel Drupal
   • In the top menu, click Configuration /Development /Performance.
   • Click the Clear cache button.

You can create a dump via phpMyAdmin. You can also dump via the console. We will consider both options.

Creating a dump via phpMyAdmin

1. Log in to the admin panel.
2. Go to the phpMyAdmin menu.

   phpMyAdmin
3. Select the required database on the left. The main window displays a list of tables.
  
export-db
4. Click the Export button. A new page will open.
5. Click Go and save the file.
  
export-db02

Creating a dump via the console on Linux

To save the database dump, enter the following command in the terminal:   

mysql -u login_user -p user_name database_name> path /and /filename_s_dump.sql 

Press Enter.

Creating a dump via the console on Linux (Drush)

If you have Drush installed, enter the following command in the terminal:   

drush sql-dump> path_and_file_name_s_dump.sql

Press Enter.

Creating a dump via the console on Windows

Open a command prompt (Win + R, or Start / Standard / Command Prompt).
Using the command line, go to the folder where the MySQL server is installed. To do this, enter the command:   

cd path/to/folder/installation/server/MySQL

Press Enter.

Go to the executable files folder. To do this, enter the command:
  
cd bin

Press Enter.

Save the dump of the database to a file. To do this, enter the command:
  
mysqldump.exe -e -u login_user -p username username_database_name> path / and / filename_d_dump.sql

Press Enter.

Transferring site files

After you have made a database backup, you need to transfer the site files to a new hosting. To do this, create an archive. The transfer of the archive is faster and safer than transferring each file separately. After you have downloaded the site archive, download it to our hosting and unzip it.

Importing a database dump

Before importing a dump, you first need to create a database. How to do it:

  • How to create a DB in ISPmanager
  • How to create a DB in cPanel

After creating the database, you need to import the dump. You can do this both in the admin panel and through the console.

Importing dump through phpMyAdmin

Log in to the admin panel.
Next go to the phpMyAdmin menu.
  

phpMyAdmin

From the menu on the left, select your database.
  
import-db

Click on Import.
In the File to import field, select the file with the database dump that you downloaded from the old hosting.
  
import-db2

Uncheck Partial Import.
Put the format of the SQL import.
Click Go.

Importing the dump via the console on Linux

Enter the next command in the terminal:   

mysql -u login_user -p user_name database_name 

Press Enter.
Also, you can use the next set of commands:
        mysql -u login_user -p user_name database_name

        use database_name 

        source path/and/filename_d_dump.sql

Importing the dump via the console on Linux (Drush)

Through Drush it is possible to import only in it and created dumps. After the deployment of Drush, the settings.php file should already have access to the database and its name, and the database itself must be empty.

Importing dump via console on Windows

Open a command prompt (Win+R, or Start /Standard/Command Prompt).
Using the command line, go to the folder where the MySQL server is installed. To do this, enter the command:   

cd path/to/folder/installation/server/MySQL

Press Enter.
Go to the executable files folder. To do this, enter the command:
  
cd bin

Press Enter.

Import the database.

To do this, enter the command:   

mysqldump.exe -e -u login_user -p username username_database_name 

Press Enter.
That`s all, your website is in new hosting.

Quick Free Quote
We respect your privacy. NO SPAM No selling your personal data.
We will respond to your query & collect further details within 24 hours. Guaranteed!

Support

We are friendly people who love to talk. So go ahead and contact us.

Technologies

Awards & Certification