WillSquire
8/6/2015 - 10:19 AM

Moving a Drupal 7 site

Moving a Drupal 7 site

Coping files

  • Copy all files apart from the following (usually): sites//settings.php sites//files sites//private

  • Create new settings.php files from default.setting.php file

  • Ensure permissions are setup on files before either installing or going further (i.e. ownership to www-data)

  • Make the following non-writable: sites/default sites/default/settings.php

  • Change the location of the tmp directory in 'Administration » Configuration » Media' as this directory path may not longer exist (note this might not be nessary. Many systems use '/tmp')

Coping database

  • Turn off clean URLs (Configuration/SEARCH AND METADATA/Clean URLs) before exporting database

  • Export drupal database

  • Ensure the /sites/default/files are copied over with the database (files added by the backend are stored here, without these the database will reference non-existing files)

  • Import database into new drupal install

  • Make sure 'Temporary directory' is pointing to the right tmp directory on the new system in Home » Administration » Configuration » Media

  • Turn on clean URLs (Configuration/SEARCH AND METADATA/Clean URLs) after importing database. If there is any issue with this, ensure the mod_rewrite module is avalible/installed on the server with: sudo a2enmod rewrite sudo service apache2 restart

    And apache rewrites are allowed entirely for the given web directory by setting 'AllowOverride All' in the apache config file ('apache2.conf') often located in '/etc/apache2'.

  • Finally see 'Administration » Reports' for any additional things that might need to be addressed.

  • If this is all done, ensure any libraries PHP or anything else might be using is installed (like cURL for example, this can be gotten on Ubuntu with 'sudo apt-get install php5-curl' and 'sudo service apache2 restart' to restart server).

DON'T USE BACKUP AND MIGRATE! IT INTEGRATES AN EXPORTED DATABASE IN RATHER THAN REPLACING IT! FIELDS CAN REMAIN