Migrating a Drupal site to a new server

30 Oct

This article will explain how to move a drupal installation, from one web server, to another. This often happens when you have created a website on a testing server, and then move it to the live server. It can also occur when you are moving to another hosting company and need to transfer your site to your new server.

In order to transfer/migrate your site onto a new server, do the following:

  • Disable clean urls (you can do this at /admin/settings/clean-urls)
  • Export your database (programs suich as phpMyAdmin are often used for this purpose)
  • Upload all of your files to the new server (where the site will be hosted)
  • Import your database onto the new server (phpMyAdmin can also be used for an Import)
  • Amend your database connection details in sites/default/settings.php file
  • Upload .htaccess file with apache Drupal settings
  • Enable clean urls (in the same place you disabled them in step 1)

Potential Problems

If you encounter any problems, such as, missing content - error messages or images not displaying, ensure the following:

  • Your database is the most recent version and there are no missing tables (look at table count in phpMyAdmin)
  • All modules and files are uploaded from sites/all/ directory
  • The files directory is writeable at sites/all/default/files (see below for making this writeable)
  • Cron has been run at /cron.php
  • Cache has been cleared in Administer > Performance > Clear Cache

Permissions

The sites/all/default/files directory needs to be made writeable for Druapl (so users can upload files/images etc). To do this, you need to change the ownership of the file to apache (www-data). To do this use the following command:

chown -R /directory/directory/yoursite.co.uk/sites/all/default/file

You will need a command line client such as Putty for this purpose.

Posted by: garry

Back to all articles

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.