Forums / Upgrading from 1.2 to 1.3.x / Database Upgrade 1.3.0.1 to 1.3.0.2

Database Upgrade 1.3.0.1 to 1.3.0.2

Locked

Started by forum5 on 7 Aug 2006, 2:50 AM · Views: 6,088

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
7 Aug 2006, 2:50 AM
#1
forum5 avatar

forum5

Zen Follower

Join Date:
Jul 2006
Location:
Louisiana
Posts:
147
Plugin Contributions:
0

Database Upgrade 1.3.0.1 to 1.3.0.2

In the Admin panel The following is displayed:

" Your database appears to need patching to a higher level. See Tools->Server Information to review patch levels."

When I See Tools->Server Information I display the following:

Zen Cart 1.3.0.2
Database Patch Level: 1.3.0.1
v1.3.0   [2006-08-06 18:44:50]   (Version Update 1.2.7->1.3.0)
v1.2.7   [2006-08-06 18:44:47]   (Version Update 1.2.6->1.2.7)
v1.2.6   [2006-08-06 18:44:47]   (Version Update 1.2.5->1.2.6)
v1.2.5   [2006-08-06 18:44:47]   (Version Update 1.2.4->1.2.5)
v1.2.4   [2006-08-06 18:44:44]   (Version Update 1.2.3->1.2.4)
v1.3.0.2   [2006-08-06 18:43:52]   (Version Update 1.3.0.1->1.3.0.2)
v1.3.0.1   [2006-08-06 18:43:52]   (Version Update 1.3.0->1.3.0.1)
v1.3.0   [2006-08-06 18:43:52]   (Version Update 1.2.7->1.3.0)
v1.2.7   [2006-08-06 18:43:49]   (Version Update 1.2.6->1.2.7)
v1.2.6   [2006-08-06 18:43:49]   (Version Update 1.2.5->1.2.6)
v1.2.5   [2006-08-06 18:43:48]   (Version Update 1.2.4->1.2.5)
v1.2.4   [2006-08-06 18:43:42]   (Version Update 1.2.3->1.2.4)
v1.2.3   [2005-02-12 21:42:19]   (Version Update 1.2.2->1.2.3)
v1.2.3   [2005-02-12 21:42:19]   (Version Update 1.2.2->1.2.3)
v1.2.3   [2005-01-20 17:55:47]   (Fresh Installation)
```What version is my database?  it looks like it was done.  I don't know why the listing is out of sequence. but 1.3.0.1->1.3.0.2 was done at 18:43:52

I tried to force the sql patch again and it halted with duplicate Key for user "Admin".  

Should I run the second half of the sql query to bump the database version number?
7 Aug 2006, 3:04 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

Forum5:

I tried to force the sql patch again and it halted with duplicate Key for user "Admin".

Should I run the second half of the sql query to bump the database version number?
You should re-run all the commands "after" the duplicate-key-for-admin statement.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Aug 2006, 3:27 AM
#3
forum5 avatar

forum5

Zen Follower

Join Date:
Jul 2006
Location:
Louisiana
Posts:
147
Plugin Contributions:
0

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

DrByte:

You should re-run all the commands "after" the duplicate-key-for-admin statement.

I hate to post the file that everyone must have but here ya go.

#
* This SQL script upgrades the core Zen Cart database structure from v1.3.0.1 to v1.3.0.2
# *
# * @package Installer
# * @access private
# * @copyright Copyright 2003-2006 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: mysql_upgrade_zencart_1301_to_1302.sql 3777 2006-06-15 07:03:03Z drbyte $
#

## CONFIGURATION TABLE
#inserts for those who did an upgrade from 1.2.x to 1.3.0 and thus didn't get the insert:
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Meta Tags Generated Description Maximum Length?', 'MAX_META_TAG_DESCRIPTION_LENGTH', '50', 'Set Generated Meta Tag Description Maximum Length to (words) Default 50:', '18', '71', '', '', now());
#tidy sort order for consistency between upgrades and fresh installs
UPDATE configuration SET sort_order=115 WHERE configuration_key = 'SHOW_ACCOUNT_LINKS_ON_SITE_MAP';

# add ability to send newsletters to self
INSERT INTO query_builder ( query_category , query_name , query_description , query_string ) VALUES ('email,newsletters', 'Administrator', 'Just the email account of the current administrator', 'select \'ADMIN\' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from TABLE_ADMIN where admin_id = $SESSION:admin_id');

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('State - Always display as pulldown?', 'ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN', 'false', 'When state field is displayed, should it always be a pulldown menu?', 5, '5', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());


#############

#### VERSION UPDATE COMMANDS
## THE FOLLOWING 2 SECTIONS SHOULD BE THE "LAST" ITEMS IN THE FILE, so that if the upgrade fails prematurely, the version info is not updated.
##The following updates the version HISTORY to store the prior version's info (Essentially "moves" the prior version info from the "project_version" to "project_version_history" table
#NEXT_X_ROWS_AS_ONE_COMMAND:3
INSERT INTO project_version_history (project_version_key, project_version_major, project_version_minor, project_version_patch, project_version_date_applied, project_version_comment)
SELECT project_version_key, project_version_major, project_version_minor, project_version_patch1 as project_version_patch, project_version_date_applied, project_version_comment
FROM project_version;

## Now set to new version
UPDATE project_version SET project_version_major='1', project_version_minor='3.0.2', project_version_patch1='', project_version_patch1_source='', project_version_patch2='', project_version_patch2_source='', project_version_comment='Version Update 1.3.0.1->1.3.0.2', project_version_date_applied=now() WHERE project_version_key = 'Zen-Cart Main';
UPDATE project_version SET project_version_major='1', project_version_minor='3.0.2', project_version_patch1='', project_version_patch1_source='', project_version_patch2='', project_version_patch2_source='', project_version_comment='Version Update 1.3.0.1->1.3.0.2', project_version_date_applied=now() WHERE project_version_key = 'Zen-Cart Database';

#####  END OF UPGRADE SCRIPT

It fails at # add ability to send newsletters to self
Do I re-start at: INSERT INTO configuration (configuration_title, configuration_key, or just go to the next section and bump the database number?
.

7 Aug 2006, 4:11 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

Start at the next statement.

If you don't, then all the things that need to be set are not done, and then your system will detect an out-of-date database again ... which will have you pulling your hair out.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Aug 2006, 3:03 PM
#5
yamcart avatar

yamcart

New Zenner

Join Date:
Aug 2006
Location:
Baltimore
Posts:
15
Plugin Contributions:
0

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

May I enter this discussion?

I'm new to Zen-Cart, (less than one week now), and tried to upgrade 1.3.0.1 to 1.3.0.2 today. I downloaded the "changed files only" and set about uploading each file into the propr directory. At the end, I saw the files in a folder named "zc_install" and have no idea what to do with them.

I opened my Zen-Cart store, to see how it fared. I got an error message atop the site that says:

Your database appears to need patching to a higher level. See Admin->Tools->Server Information to review patch levels.

Whoa. I have no idea what to do next. Please excuse my ignorance and let me know what to do with the "zc_install" files and how to patch my DB to a higher level.

I stink, therefore I am.

9 Aug 2006, 4:33 PM
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,893
Plugin Contributions:
20

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

there is a database upgrade involved with the move to 1.3.0.2

You picked the right files as you were going from 1.3.0.1 to 1.3.0.2 (always use the full fileset if jumping a step like 1.2.7d to 1.3.0.2)

The zc_install directory allows you to do the next step in the upgrade.

Go to mysite.com/zc_install and go through the first two pages to page three(System Inspection). Don't be alarmed if you see any error codes at the top saying "ATTENTION: Problems found:"

There will be a button at the bottom for Database Upgrade. Click on it and follow the directions to update the database.

That should do it

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

9 Aug 2006, 4:42 PM
#7
yamcart avatar

yamcart

New Zenner

Join Date:
Aug 2006
Location:
Baltimore
Posts:
15
Plugin Contributions:
0

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

Thanks for that help -- you're awesome.

I followed those steps using the Zen-Cart install/upgrade tool. Pretty cool. But then it seems to have gotten stuck or something, and gave me this message in the browser window:

1062 Duplicate entry 'Administrator' for key 2
in:
[INSERT INTO zen_query_builder ( query_category , query_name , query_description , query_string ) VALUES ('email,newsletters', 'Administrator', 'Just the email account of the current administrator', 'select 'ADMIN' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from TABLE_ADMIN where admin_id = $SESSION:admin_id');]

Wow -- do you know what that means? (I surely don't...)

I stink, therefore I am.

9 Aug 2006, 4:53 PM
#8
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,893
Plugin Contributions:
20

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

check out drbyte's remedy at this link

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

9 Aug 2006, 5:19 PM
#9
yamcart avatar

yamcart

New Zenner

Join Date:
Aug 2006
Location:
Baltimore
Posts:
15
Plugin Contributions:
0

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

Hey -- it worked. You're awesome. I can't thank you enough. (I was sweating bullets for a little while there...)

How can I hope to learn this kind of stuff -- it's so arcane. There will be more upgrades (hopefully) along the way, and I hope I can be better able to handle the next one.

Where does one go to learn all the details of self-management for a Zen-Cart store?

I stink, therefore I am.

9 Aug 2006, 5:27 PM
#10
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,893
Plugin Contributions:
20

Re: Database Upgrade 1.3.0.1 to 1.3.0.2

Minor pet peeve of mine is that you are not first given an opportunity to look at the docs before installing or upgrading. And, most folks read past the invitation on the last page of the install.

That said, you'll find a lot of helpful info at https://www.yoursite.com/docs, in the FAQ's, and the wiki. Study those and start with Configuration in the admin section of your site and work your way top to bottom - left to right through the admin.

As Ajeh says, "You might just learn something!" :D

Oh yeah, one other thing folks forget to do. READ THE DOs and DON'Ts That speeds up the help process SOOOO MUCH!

Hang in there:thumbsup:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com