Zen Cart Logo
Forums / Upgrading to 2.x.x / zc_install issue

zc_install issue

Views: 1,429

Results 1 to 20 of 27
22 Dec 2024, 13:17
#1
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

zc_install issue

Hi There,

I have set up a test site on my PC using xampp with php8.2 and downloaded zc 2.1.0. Everything is working as I expect and I have created a database using the data imported from my live site which is running under v1.5.6 with php7.2. When I run zc_install after entering all the required data the installer immediately creates a new database, I do not get the button options Upgrade or Clean Install? Any ideas on what I am doing wrong please?

Michael

22 Dec 2024, 16:47
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: zc_install issue

You need to ensure that your /admin/includes/configure.php and /includes/configure.php files are 'pointing to' that copy of your database and that the DB_PREFIX identified in those files also matches that used in the database copy.

22 Dec 2024, 19:12
#4
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

lat9:

You need to ensure that your /admin/includes/configure.php and /includes/configure.php files are 'pointing to' that copy of your database and that the DB_PREFIX identified in those files also matches that used in the database copy.

Thanks for that. I have rechecked and changed both configure files but the same happens, the installer just creates a new database, I do not get the option to upgrade

22 Dec 2024, 19:51
#5
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

It's obviously me but I just cannot see my error(s), DB-Prefix is left blank as I always do so it's not that. I did wonder if for some reason the installer couldn't see the existing database in the MySQL area of the xampp setup, but then that is where it puts the newly created database, so it cannot really be that, I think...

22 Dec 2024, 20:33
#6
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: zc_install issue

>I have created a database using the data imported from my live site

What exactly do you mean by that?

You create the new database with the ZC210 install.
Then you import your 157 database into the new ZC210 database in phpmyadmin or suchlike.
Then you run the installer again which should spot that the db in question is v157 and consequently offer to upgrade/make the changes introduced from 158 to 210.

22 Dec 2024, 21:20
#7
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

torvista:

>I have created a database using the data imported from my live site

What exactly do you mean by that?

You create the new database with the ZC210 install.
Then you import your 157 database into the new ZC210 database in phpmyadmin or suchlike.
Then you run the installer again which should spot that the db in question is v157 and consequently offer to upgrade/make the changes introduced from 158 to 210.

Ah Ok, maybe where I am misunderstanding. I created a new database in phpMyAdmin and then imported my live database into it. I then ran the upgrade using that database's credentials, obviously not the correct way?

22 Dec 2024, 21:47
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: zc_install issue

Mikeondraco:

Ah Ok, maybe where I am misunderstanding. I created a new database in phpMyAdmin and then imported my live database into it. I then ran the upgrade using that database's credentials, obviously not the correct way?
That is the correct way. You should find a couple of .log files in the site's /logs directory that have zcinstall somewhere in their name.

Those logs' contents should contain information that identifies why the install process couldn't find your existing database tables.

22 Dec 2024, 21:58
#9
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

lat9:

That is the correct way. You should find a couple of .log files in the site's /logs directory that have zcinstall somewhere in their name.

Those logs' contents should contain information that identifies why the install process couldn't find your existing database tables.

Thank you, so the way I am doing it is correct, just misconfiguring the installer somewhere then? I will search out the log files. Thanks again ... Michael

23 Dec 2024, 00:10
#10
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: zc_install issue

check if you have an

includes/local/configure.php

that would prevent the installer from doing an upgrade.

23 Dec 2024, 09:38
#11
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,866
Plugin Contributions:
7

Re: zc_install issue

Sorry to muddy the waters further, I need to correct that

You manually create a new database with phpMyAdmin.
You populate the new database using the ZC210 installer, as a Clean Install, which creates the two configure.php with the db credentials. At this point the ZC210 shop should be functioning, albeit with no products.
Then you manually import your 157 database into the ZC210 database in phpmyadmin or suchlike, effectively overwriting the contents.
Then you run the installer again which should spot that the db in question is v157 and consequently offer to upgrade/make the changes introduced from 158 to 210.

23 Dec 2024, 11:25
#12
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: zc_install issue

You manually create a new database with phpMyAdmin.

If you have cPanel, the app for creating databases will be called "Manage My Databases" or "MySQL Databases."

23 Dec 2024, 12:34
#13
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

Mikeondraco:

Thank you, so the way I am doing it is correct, just misconfiguring the installer somewhere then? I will search out the log files. Thanks again ... Michael

Hi There, one last day of attempting this before I lose my mind... I tried again this morning with the same results, the first few entries of the error log are:

Dec 23 2024 13:06 -- ADMIN FILE TEST
C:\xampp82\htdocs\dracocrafts\admin/C:\xampp82\htdocs\dracocrafts\includes/configure.php


Dec 23 2024 13:06 -- systemChecker::findCurrentDbVersion
Cannot Be Determined


Dec 23 2024 13:06 -- systemChecker::hasSaneConfigFile
FALSE


Dec 23 2024 13:06 -- systemChecker::hasSaneConfigFile
FALSE

I am slowly getting out of my depth now but I think that the upgrade fails because the db version cannot be obtained. Is this correct and if so why? ... Michael

23 Dec 2024, 15:51
#14
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: zc_install issue

The issue appears to be admin/includes/configure.php:

Dec 23 2024 13:06 -- ADMIN FILE TEST
C:\xampp82\htdocs\dracocrafts\admin/[B]C:\xampp82\htdocs\dracocrafts\[/B]includes/configure.php

The highlighted section shouldn't be there. How about posting the contents of both the admin/includes/configure.php and /includes/configure.php?

Be sure to post those contents in the "CODE" tags using the big **# **in the menu-bar while you're writing your response.

23 Dec 2024, 16:01
#15
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: zc_install issue

Remember not to post the line that sets DB_SERVER_PASSWORD when you post your configure file.

23 Dec 2024, 17:20
#16
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

Ok, here goes, I will kick myself when you tell me what I have missed... Here are the 'dist-config files' before running (incidentally, should they be renamed 'configure' before running?)

admin/includes/dist-configure

<?php
/**
 * dist-configure.php - SAMPLE FILE!
 *
 * @copyright Copyright 2003-2022 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: DrByte 2021 Jan 23 Modified in v1.5.8-alpha $
 * @private
 */

/*************** NOTE: This file is VERY similar to, but DIFFERENT from the "store" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.              ***********/

/**
 * Enter the domain for your Admin URL. If you have SSL, enter the correct https address in the HTTP_SERVER setting, instead of just an http address.
 */
define('HTTP_SERVER', 'https://localhost');
/**
 * Note about HTTPS_SERVER:
 * There is no longer an HTTPS_SERVER setting for the Admin. Instead, put your SSL URL in the HTTP_SERVER setting above.
 */

/**
 * Note about DIR_WS_ADMIN
 * The DIR_WS_ADMIN value is now auto-detected.
 * In the rare case where it cannot be detected properly, you can add your own DIR_WS_ADMIN definition below.
 */

/**
 * Enter the domain for your storefront URL.
 * Enter a separate SSL URL in HTTPS_CATALOG_SERVER if your store supports SSL.
 */
define('HTTP_CATALOG_SERVER', 'http://localhost');
define('HTTPS_CATALOG_SERVER', 'https://localhost');

/**
 * Do you use SSL for your customers login/checkout on the storefront? If so, enter 'true'. Else 'false'.
 */
define('ENABLE_SSL_CATALOG', 'true');

/**
 * These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
 * These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
 * They should always start and end with a slash ... ie: '/' or '/foldername/'
 */
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

/**
 * This is the complete physical path to your store's files.  eg: /var/www/vhost/accountname/public_html/store/
 * Should have a closing / on it.
 */
define('DIR_FS_CATALOG', '/var/www/vhost/accountname/public_html/store/');

/**
 * NOTE about DIR_FS_ADMIN
 * The value for DIR_FS_ADMIN is now auto-detected.
 * In the very rare case where there is a need to override the autodetection, simply add your own definition for it below.
 */

/**
 * The following settings define your database connection.
 * These must be the SAME as you're using in your non-admin copy of configure.php
 */
define('DB_TYPE', 'mysql'); // always 'mysql'
define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
define('DB_CHARSET', 'utf8'); // 'utf8' or 'latin1' are most common
define('DB_SERVER', 'localhost');  // address of your db server
define('DB_SERVER_USERNAME', 'Mikeondraco');
define('DB_SERVER_PASSWORD', 'xxxxxxxxxxxxxxxxxx');
define('DB_DATABASE', 'dczencart8.2');
/**
 * This is an advanced setting to determine whether you want to cache SQL queries.
 * Options are 'none' (which is the default) and 'file' and 'database'.
 */
define('SQL_CACHE_METHOD', 'none');

/**
 * Reserved for future use
 */
define('SESSION_STORAGE', 'temporary value added by zc_install');

/**
 * Advanced use only:
 * The following are OPTIONAL, and should NOT be set unless you intend to change their normal use. Most sites will leave these untouched.
 * To use them, uncomment AND add a proper defined value to them.
 * For your security, if you are using the backups or downloads folders,
 * move them ABOVE your public_html folder.
 */
// define('DIR_FS_SQL_CACHE' ...
// define('DIR_FS_DOWNLOAD' ...
// define('DIR_FS_BACKUP' ...
// define('DIR_FS_LOGS' ...

// End Of File

and the includes/dist-config

<?php
/**
 * dist-configure.php - SAMPLE FILE!
 *
 * @copyright Copyright 2003-2022 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: DrByte 2021 Jan 23 Modified in v1.5.8-alpha $
 * @private
 */

/*************** NOTE: This file is VERY similar to, but DIFFERENT from the "admin" version of configure.php. ***********/
/***************       The 2 files should be kept separate and not used to overwrite each other.              ***********/

/**
 * Enter the domain for your store
 * If you have SSL, enter the correct https address in BOTH the HTTP_SERVER and HTTPS_SERVER settings, instead of just an http address.
 */
define('HTTP_SERVER', 'http://localhost');
define('HTTPS_SERVER', 'https://localhost');

/**
 * If you have https enabled on your website, set this to 'true'
 */
define('ENABLE_SSL', 'true');

/**
 * These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
 * These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
 * They should always start and end with a slash ... ie: '/' or '/foldername/'
 */
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

/**
 * This is the complete physical path to your store's files.  eg: /var/www/vhost/accountname/public_html/store/
 * Should have a closing / on it.
 */
define('DIR_FS_CATALOG', '/var/www/vhost/accountname/public_html/store/');

/**
 * The following settings define your database connection.
 * These must be the SAME as you're using in your admin copy of configure.php
 */
define('DB_TYPE', 'mysql'); // always 'mysql'
define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
define('DB_CHARSET', 'utf8'); // 'utf8' or 'latin1' are most common
define('DB_SERVER', 'localhost');  // address of your db server
define('DB_SERVER_USERNAME', 'Mikeondraco');
define('DB_SERVER_PASSWORD', '1TL5J9FAR2T-101224');
define('DB_DATABASE', 'dczencart8.2');

/**
 * This is an advanced setting to determine whether you want to cache SQL queries.
 * Options are 'none' (which is the default) and 'file' and 'database'.
 */
define('SQL_CACHE_METHOD', 'none');

/**
 * Reserved for future use
 */
define('SESSION_STORAGE', 'temporary value added by zc_install');

/**
 * Advanced use only:
 * The following are OPTIONAL, and should NOT be set unless you intend to change their normal use. Most sites will leave these untouched.
 * To use them, uncomment AND add a proper defined value to them.
 */
// define('DIR_FS_SQL_CACHE' ...
// define('DIR_FS_DOWNLOAD' ...
// define('DIR_FS_LOGS' ...

// End Of File
23 Dec 2024, 17:41
#17
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

BTW, don't worry that I showed the passwords, it's a completely offline development computer, everything will be changed when/if it goes online :smile:

23 Dec 2024, 18:38
#18
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: zc_install issue

My guess would be that these values

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

should be '/store/' in both files.

24 Dec 2024, 15:24
#19
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: zc_install issue

swguy:

My guess would be that these values

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

should be '/store/' in both files.

I take it you mean the name of my store?

24 Dec 2024, 16:44
#20
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: zc_install issue

No. The exact string I used, since your store is in a subfolder called "store."