i want to run two identical copies of my drupal 4.7site on my server simultaneously so that i can upgrade 1 copy to drupal 5.1 and leave the other with the same content as drupal4.7. and then compare the two drupal versions side-by-side with the same content.

i cannot get this to work.

my original 4.7 install is in an home/public_html/drupal directory

i copied the orginal 4.7 diriectory to a home/public_html/test/drupal subdirectory

then i created a new database for the second copy of drupal
i then copied the original database to the new database
i changed the settings.php and settings1.php files in the /test/drupal copy to be directed to the new database
the new instance will start ok when i goto http://mysite.com/test/drupal

but i cant login into the new iteration with my passwords from the first install, and when i try to do this,
the first installed drupal database gets corrupted and there are permanent login problems.

has anyone run two identical copies of a drupal 4.7 site on the same server just in different directories? if so what am i doing wrong? alternatively is there away that i can run a 4.7 install and a 5.1 install with the same database and logins?

Comments

Anonymous’s picture

Have you set up the RewriteBase path in the .htaccess file for your new site? I had similar issues trying to run a second install in a subdirectory on the same server.

Barry

psr’s picture

nope i had not considered that. is this the part you mean in the .htaccess file, The 'url rewrite section': would i change all the /drupal/ entries to /test/drupal/ manually even though it says do not edit this section or is there something else?

# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)

RewriteEngine On

RewriteBase /drupal/

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_FILENAME} !/drupal/index\.php$
RewriteRule . - [L]

RewriteCond %{THE_REQUEST} \ /drupal/d/([0-9]+)-([0-9]+)/([^\/\?]+)(\?.|\ .)
RewriteCond %{REQUEST_FILENAME} !/drupal/index\.php$
RewriteRule . /drupal/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]

RewriteCond %{THE_REQUEST} \ /drupal/v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_FILENAME} !/drupal/index\.php$
RewriteRule . /drupal/index.php?q=gallery&g2_view=core.ShowItem&g2_path=%1 [QSA,L]

# END Url Rewrite section

Anonymous’s picture

Change:

RewriteBase /drupal/

to

RewriteBase /test/drupal/

(assuming that's your folder set up)

You should be able to leave the rest alone I believe.

EDIT:

Here is that section from my .htaccess and most of it is still commented out:

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the prefix www. you
  # can use one of the following settings to force user to use only one option:
  #
  # If you want the site to be accessed WITH the www. only, adapt and
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule .* http://www.example.com/ [L,R=301]
  #
  # If you want the site to be accessed only WITHOUT the www. prefix, adapt
  # and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule .* http://example.com/ [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  RewriteBase /dev/goss

  # Rewrite old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

  # Rewrite current-style URLs of the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
psr’s picture

the htaccess change did the trick. only thing is now i cant be logged into both sites simultaneously. when i log into one it logs me out of the other. any ideas on how i can stay logged in on both sites?

i tried changing logins and passwords so they were different between sites but made no difference. why are the sites interacting like this when they have separate databases and url paths?

anyway
thanks iBaz

Anonymous’s picture

Sounds like a problem with session cookies, where the session domain is being set the same for each site, so the one overwrites the other. In your settings.php file for the 'test' site, find this code:

/**
 * We try to set the correct cookie domain. If you are experiencing problems
 * try commenting out the code below or specifying the cookie domain by hand.
 */
if (isset($_SERVER['HTTP_HOST'])) {
  $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
  // Per RFC 2109, cookie domains must contain at least one dot other than the
  // first. For hosts such as 'localhost', we don't set a cookie domain.
  if (count(explode('.', $domain)) > 2) {
    ini_set('session.cookie_domain', $domain);
  }
}

You could try commenting out the whole thing, or add another line to set the cookie path:

/**
 * We try to set the correct cookie domain. If you are experiencing problems
 * try commenting out the code below or specifying the cookie domain by hand.
 */
if (isset($_SERVER['HTTP_HOST'])) {
  $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
  // Per RFC 2109, cookie domains must contain at least one dot other than the
  // first. For hosts such as 'localhost', we don't set a cookie domain.
  if (count(explode('.', $domain)) > 2) {
    ini_set('session.cookie_domain', $domain);
    ini_set('session.cookie_path', '/test/drupal');
  }
}

I haven't tested this.

Barry