If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading from 1.3.x to 1.3.9 / server using $_ENV{DATABASE_SERVER} for configure.php database server

server using $_ENV{DATABASE_SERVER} for configure.php database server

Locked

Started by delia on 26 Dec 2010, 3:43 PM · Views: 4,368

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
26 Dec 2010, 3:43 PM
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

server using $_ENV{DATABASE_SERVER} for configure.php database server

Well, this is a new one for me - amazing how new jobs bring new problems!
I'm trying to upgrade a 1.3.7 cart on a dedicated server (mediatemple) and the configure files are using $_ENV{DATABASE_SERVER} instead of the name of the database server. I gather this is the only way to get zen cart to work but the upgrade script is very unhappy. They have used a db prefix so I can't easily force the upgrade by just running the sql scripts.

Is there any way to alter the upgrade scripts to allow for this? Or is there a work around I can use?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

26 Dec 2010, 5:02 PM
#2
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

Starting on Line 70 of zc_install\includes\modules\pages\database_setup\header_php.php(87) you have this code:

if ($is_upgrade) { // read previous settings from configure.php
    $zdb_type       = zen_read_config_value('DB_TYPE');
    $zdb_coll       = zen_read_config_value('DB_CHARSET');
    if ($zdb_coll != 'utf8') $zdb_coll = 'latin1';
    $zdb_prefix     = zen_read_config_value('DB_PREFIX');
    $zdb_server     = zen_read_config_value('DB_SERVER');
    $zdb_user       = zen_read_config_value('DB_SERVER_USERNAME');
    $zdb_pwd        = zen_read_config_value('DB_SERVER_PASSWORD');
    $zdb_name       = zen_read_config_value('DB_DATABASE');
    $zdb_sql_cache  = ($zc_install->getConfigKey('DIR_FS_SQL_CACHE')=='') ? zen_read_config_value('DIR_FS_SQL_CACHE') : $zc_install->getConfigKey('DIR_FS_SQL_CACHE');
    $zdb_cache_type = zen_read_config_value('SQL_CACHE_METHOD');
    $zdb_persistent = zen_read_config_value('USE_PCONNECT');
    $zdb_sessions   = (zen_read_config_value('STORE_SESSIONS')) ? 'true' : 'false';
  } else { // set defaults:
    $zdb_type       = 'MySQL';
    $zdb_coll       = 'latin1';
    $zdb_prefix     = '';
    $zdb_server     = 'localhost';
    $zdb_user       = '';
    $zdb_name       = 'zencart';
    $zdb_sql_cache  = $zc_install->getConfigKey('DIR_FS_SQL_CACHE');
    $zdb_cache_type = 'none';
    $zdb_persistent = 'false';
    $zdb_sessions   = 'true';
  } //endif $is_upgrade

That's the only code (I believe) that you need to edit for the upgrade of an older version database using the new zc_install, but check your two configure.php files afterwards.

Vger

26 Dec 2010, 6:51 PM
#3
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

very valuable information - Thanks!

But I must have been wrong because nothing I do works.

The error message I'm getting is

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I checked and this is cgi php which I've not had had much eperience with.

I'm about to pull the database to another server to upgrade but I was hoping to find out what's happening here.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

27 Dec 2010, 2:16 PM
#4
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

That message normally means that the MySQl service is not running on the server. However you unfortunately signed up with a company which uses a "Grid System" which seems to be unique to them and which no one else (apparently) uses.

I'm assuming that it's either something like "load balancing" across multiple servers, or else some kind of "cloud" hosting.

Either way I suspect that no one here would know anything about this "grid system".

Vger

27 Dec 2010, 2:46 PM
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: server using $_ENV{DATABASE_SERVER} for configure.php database server

Good, that means I probably won't run into it again! Thanks for the replies!

I did go ahead and set up a zen cart on my server and upgraded there then imported it back in. What a pain!

I believe these folks are getting free hosting from a friend. See what freebies get ya!

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo