Test Drupal Installation Before Go Live

For my sins, I decided to move over to Wordpress a couple of months ago. However I saw the light pretty soon and wanted to switch back to a new version of Drupal. This article shows how you can test an installation while still running another site on the front end.

I made the Wordpress installation in it's own folder in document root. My previous installation of Drupal was in the root directory also, but not in it's own folder. Here are the steps I took to install the new version, test it then make it live and replace Wordpress meaning a minimum down time. This was of course thoroughly tested on a local server before making changes to my production server.

My Apache server is Apache/1.3.37 (Unix) and I have the option to run PHP as version 4 or 5. To enable PHP5 I must have the .php5 extension so I have used this to run my current Drupal install. Wordpress was using standard .php and I had mod_rewrite enabled.

My first steps were to change the existing Drupal files. In my case I deleted all relevant files and started again. I wanted a clean install. You can check out the Drupal manual to see how to upgrade the proper way. I then uploaded all files except for the main index.php and .htaccess. Instead of this file I renamed my local index.php to index.php5 and uploaded to the root directory.

From there you can essentially run your site through index.php5 with the exception of a few links from the install script and upgrade scripts. I of course could use rewrite yet as it was being used by Wordpress so I made one change to the common.inc file and re-uploaded it to the server.


<?php //~ LINE: 1168 (original code)
  
if (empty($script)) {
    
// On some web servers, such as IIS, we can't omit "index.php". So, we
    // generate "index.php?q=foo" instead of "?q=foo" on anything that is not
    // Apache. (CHANGE $script below)
    
$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === FALSE) ? 'index.php' '';
    
//~ CHANGE TO  
    
$script 'index.php5';
  }



You can now test your installation through http://yourdomain.com/index.php5. Once you have tested and are happy with everything (exceptions noted) you can then upload your new .htaccess making sure that you have changed all reference to index.php to index.php5.

Syndicate content