How to Move a Drupal Website from Localhost to the Live Server?

How to Move a Drupal Website from Localhost to the Live Server?

Are you looking for a step by step tutorial for transferring or moving a Drupal website from localhost to the live server then you landed up on the correct web page. Here in this article I am going to focus on the following given points:

  1. Important points to know before moving your Drupal website from your local computer to the live server
  2. Easy and secure tips to take the backup of Drupal database and files
  3. Uploading your Drupal’s website’s database to your server
  4. Uploading your Drupal’s website’s files and folders to your server
  5. Making changes in the settings file of Drupal setup
  6. Testing and Troubleshooting for your Drupal Website

Important Points to Know before Moving Your Drupal Website from Your Local Computer to the Live Server

First of all when you move your Drupal website from localhost to the server then you need to have proper knowledge of your database name, database server username, database server password of your localhost. Apart from this you must have the cPanel and FTP login detail of the server where you are uploading your site. Obviously you need a FTP application too, I would recommend you FileZilla because it is free of cost available for all the operating systems.

Very important! When you will backup your database of Drupal website you must empty the cache tables before backing up everything. There are few tables in Drupal starting with ‘cache_’ or ‘<prefix>_cache_’ so find out them and clear these tables properly otherwise you will face a very worse condition in database backup. Your database might be too heavy because of unnecessary cache in Drupal database tables.

Sometimes you need to change Drupal files permissions to 777 so that you can edit and upload them properly. After editing the file change their permission to the default.

Easy and Secure Tips to Take the Backup of Drupal Database and Files

Open up your phpMyAdmin on your localhost and select your database and export it in .sql file. Create a .zip or .sql file only. Do not create .gzip file because some servers don’t support this compression format.

Uploading your Drupal’s Website’s Database to Your Server

Now login to your cPanel by entering the given login details by your server administrator after buying the hosting and domain. Then click on phpMyAdmin icon and import your database there. I am not explaining all the steps because every server has a little different process to do it. If you have any issue then please contact your server administrator they will guide you properly. You need to create a database name, database server username, and database server password here.

Uploading your Drupal’s Website’s Files and Folders to Your Server

Now open your FTP application and enter the appropriate login details as you were given by your server admin to upload your Drupal website. Select all the files and folders available in Drupal setup and move then to the public_html folder (this folder name may vary server to server).

Making Changes in the Settings file of Drupal Setup

Open your settings.php file available at sites/default/settings.php to match your localhost sql settings. It will require database name, database server username, database server password, and database prefix (if you have).

Testing your Drupal Website

Now open your Drupal website by entering the proper url of the site.

This is just a step by step simple guide to transfer a Drupal website from local computer to the server. You might face many issues in this process too. For example you site can throw few errors too. So in case of any error or warning please let me know in the comments. I will try my level best to rectify the issue.


Leave a Reply

You must be logged in to post a comment.

Copy link