drupal: steps to set your website live (localhost to server)

Here are the steps to move your drupal website from localhost to live server:

  1. update /drupal/sites/<all_your_site_folders>/settings.php to match your new sql settings
  2. empty localhost db caching tables (all those tables starting with ‘cache_’ or ‘<prefix>_cache_’ )
    this is an IMPORTANT step, website did not work for me until I cleared caching tables
  3. export your sql table and load sql data on your online sql server
  4. upload your drupal files online
  5. if you are on a multisite mode:
    1. you must also rename your site folders to match new domain-name
      ex: /drupal/sites/site1.localhost should be renamed into /drupal/sites/site1.mydomain.com
    2. you might need to update filepath column values on all ‘<prefix_>files’ db tables to reflect your new folder names (otherwise documents and images uploaded via drupal (ie. not css images) will still point to localhost and not be visible). Below is slq query I used:
      UPDATE <prefix_>files SET filepath = REPLACE(filepath, 'sites/<old_folder_name>/', 'sites/<new_folder_name>/');

      note: replace <xxx> with corresponding values. In my case, prefix was ‘site3_’, old_folder_name was ‘site3.localhost’ and new_folder_name was ‘site3.example.com’
      => here is the query I ran: UPDATE site3_files SET filepath = REPLACE(filepath, ‘sites/site3.localhost/’, ‘sites/site3.example.com/’);

That’s it.

(don’t forget to correctly set up your apache / bind settings)


Post a Comment

Your email is never published nor shared. You're allow to say what you want...

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

Warning: fsockopen() [function.fsockopen]: unable to connect to www.sweetcaptcha.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81