If this is your first visit, check our documentation. To post, register or login.

apply db patches

Locked

Started by enzo_ita on 15 Jul 2010, 12:37 PM · Views: 1,604

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
15 Jul 2010, 12:37 PM
#1
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #1 by enzo_ita

Hi,
I am trying to install the 1.39d over the 1.3.8a I have working on my site with the only problem of PayPal miscalculating the order value.
Becasue of the PayPal problem I want to upgrade to the latest version.
The step I have taken are:
1.Created a test subdomain

2.Copied the working installation on the test root

3.Copied all the files of the new installation over the files of the old installation, but the zc_install that I have deleted from the old installation and copied the new one in the root.

4.Set a new db and run install with db data samples.

The test site appears perfect but obviously there are not my products neither the template is correct.

5.I go to the new db, drop all the tables in phpmysqladmin and import the backup of my db.

In home page aI get the message about applying patches to the db.
6.Run testsubdomain/zc_install and try to apply the patches.

Result this error message:

1062 Duplicate entry '1' for key 1
in:
[INSERT INTO product_types VALUES (1, 'Product - General', 'product', '1', 'Y', '', now(), now());]

I have tested other ways like:

Instead of dropping the tables in step 5. I have used the EMPTY command.
No change

Instead of dropping tables or empty them I tryied to import (overwright) no way error messages from phpmysqladmin

Use a fresch untouched installation up to step 4 and performed 5. and 6.
no changes.
I am lost. :cry:
Please help
enzo

15 Jul 2010, 1:14 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #2 by schoolboy

You must follow the upgrade procedure properly...

A critical part of the upgrade from 1.3.8 to 1.3.9 is a DATABASE UPGRADE.

The way you are doing this is incorrect... you can't simply do the upgrade, then "remove" the database by bringing in all your old database stuff.

Follow the upgrade procedure properly - including the methods of doing the dbase upgrade.

As you have correctly done, make another full backup of the site first. (Or do the full upgrade on a "clone" / copy of the site)

https://www.zen-cart.com/tutorials/index.php?article=98
https://www.zen-cart.com/tutorials/index.php?article=108

20 years a Zencart User

15 Jul 2010, 2:29 PM
#3
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #3 by enzo_ita

Hi,
thanks for your message but I do not see anything different from what I did in the documents you linked for me.

The problems is clearly in the database upgrade that fails when running the install for the second time and selecting database upgrade.

Beside the red stripe warning that the database needs to patched, my test site is well connected with the db and working. Can you be specific on what you think I did wrong?

I am relatively new to zen cart, I have three sites working and always managed to set up the db correctly, but this time I do not understand what is going on.

I repeat that also if I do an install starting from scrap with only the new version installed, when I try to have my old database contents in line, instead of the sample data, it does not work.

enzo

15 Jul 2010, 4:01 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #4 by schoolboy

5.I go to the new db, drop all the tables in phpmysqladmin and import the backup of my db.

This is where you are going wrong. DROPPING tables effectively removes them completely, so what you are getting when you CREATE IF NOT EXISTS from your original dbase, is a dbase that is actually 1.3.8.

Proper upgrades use ZC_INSTALL, as the sql patches are in this directory, and are UPGRADED via an install - where you select UPGRADE when dealing with the database.

20 years a Zencart User

15 Jul 2010, 6:25 PM
#5
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #5 by enzo_ita

Ok.
You have probably not gone completely trough my post.

Once I have installed the new db with the sample data, how can I get rid off them and install my old db data?

Restore does not exist as command in phpmysqladmin.

If I use import I get errors by phpmysqladmin as I wrote.

Should I run zc_install and apply db patches before attempting to import my old db data?

I do not think so because during a fresh installation the sample db should be already unpgraded but.....I may be wrong.

Please keep up your help.
Thanks

15 Jul 2010, 6:38 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #6 by schoolboy

You don't install a NEW database... You UPGRADE the old one.

The tutorial explains how to go about an upgrade. Short of re-writing that information here, I can't advise further.

20 years a Zencart User

15 Jul 2010, 7:58 PM
#7
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #7 by enzo_ita

From the tutorial:

Make a NEW database to install the new version of Zen Cart™ into.

If the last backup you made of your data is older than the last order that might have been processed or customer registration, make a fresh database backup.
**Restore **your database from the backup in step #1 earlier into your NEW database just created.
If I have to upgrade the old one what I have to do with the database installed/filled automatically by the zc_install? However when I try to UPGRADE the db is there I get errors and the db is not upgraded.

The command restore does not exist in the phpmysql admin
So which function should be used?
Thanks

15 Jul 2010, 9:20 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #8 by schoolboy

enzo-ita:

From the tutorial:

If I have to upgrade the old one what I have to do with the database installed/filled automatically by the zc_install? However when I try to UPGRADE the db is there I get errors and the db is not upgraded.

The command restore does not exist in the phpmysql admin
So which function should be used?
Thanks

Hi Enzo

What tutorial does the above quote come from? I'd like to read through it, as this section does not seem to be applicable to the upgrade you need to do. Point me to that tutorial and I'll try to advise further.

The one that pertains to your required upgrade is:

https://www.zen-cart.com/tutorials/index.php?article=98

If you follow this tutorial, you should be fine...

20 years a Zencart User

15 Jul 2010, 10:31 PM
#9
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #9 by enzo_ita

schoolboy:

You must follow the upgrade procedure properly...

A critical part of the upgrade from 1.3.8 to 1.3.9 is a DATABASE UPGRADE.

The way you are doing this is incorrect... you can't simply do the upgrade, then "remove" the database by bringing in all your old database stuff.

Follow the upgrade procedure properly - including the methods of doing the dbase upgrade.

As you have correctly done, make another full backup of the site first. (Or do the full upgrade on a "clone" / copy of the site)

https://www.zen-cart.com/tutorials/index.php?article=98
https://www.zen-cart.com/tutorials/index.php?article=108
The red one.
However why don't you try to tell me what restore or > Then create a new database and load your old database in it
means in practical terms or phpmysqladmin commands?
Thanks

15 Jul 2010, 11:02 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #10 by schoolboy

The point being made here, is that upgrades are best done on a FULL COPY (or CLONE) of your current site.

So, you need to COPY :-

  1. the php files (and all the other code resources).
  2. the database.

Your COPY of the database will have a different database name, (but can inherit the same database username and password).

As you know, you create a new database in your host account admin panel (C-Panel). After you do this, you have an EMPTY database.

The way I generally proceed at this point is to COPY your existing database into the NEW database, via phpMyAdmin.

In phpMyAdmin, go to your ORIGINAL database, and then click the "Operations" tab.

There you will see a screen that enables you to copy the database you are currently in, to a NEW database.

As you have already created a new database (currently empty), configure the selections to just COPY the current database to the new database (you don't need to "create" it, so un-check that option).

This takes a couple of seconds...

Then, you have TWO databases (with different names) that have identical contents.

Now... you have to point your copied PHP stuff to the new database, and this is where the configure.php changes occur.

It is on THIS copied installation that you do your upgrade.

20 years a Zencart User

16 Jul 2010, 3:22 PM
#11
starr avatar

starr

New Zenner

Join Date:
Jun 2009
Posts:
11
Plugin Contributions:
0

Post #11 by starr

schoolboy:

This is where you are going wrong. DROPPING tables effectively removes them completely, so what you are getting when you CREATE IF NOT EXISTS from your original dbase, is a dbase that is actually 1.3.8.

Proper upgrades use ZC_INSTALL, as the sql patches are in this directory, and are UPGRADED via an install - where you select UPGRADE when dealing with the database.

I am having a lot of trouble with the database upgrade but no trouble with my store at the moment.

The thing is I read everything! lots of times and check this forum, seldom do I need to ask questions, however one of the forum fixes for the data base problem with Your database appears to need patching to a higher level. See Tools->Server Information to review patch levels. is to DUMP the data base! it seemed strange to me because there doesn't appear to be any other reason for the upgrade. DUMPING leaves an empty database.

Anyway after many hours, with no success, I will try again tomorrow and read WHY I should even bother with such a nightmare.

Please WARN people not to dump the database because we trust the info that you guys provide.

BTW none of the fixes here so far work for me!

Cheers

19 Jul 2010, 2:48 AM
#12
drbyte avatar

drbyte

Sensei

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

Post #12 by drbyte

starr,
The official Zen Cart upgrade instructions DO NOT tell you to "DUMP" your database.
Be very careful whose instructions you follow.
If you are having a specific problem with your specific website, start a thread dedicated to your specific issue. No offense intended by this comment ... but ... following generic advice given to others can be dangerous, especially when the original discussion is steeped in confusion in the first place.

.
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.

19 Jul 2010, 7:40 AM
#13
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #13 by enzo_ita

Well, I have to say that the istructions refers to commands that do not exist in phpmyadmin, therefore a novice can not follow instructions that needs to be interpretated.

Finally I found a way to update to 139.d from 138.c.
Create a new name database.
Run Zc-install pointing it to the new name database,
Delete all the tables created by zc_install,
copy (this command exists) the 138 (old) database in the new name database created before doing the install
update the database using zc_install and selecting only the patch 138 to 139.

Here there is another problem with the wizard. Why it select many pathces and not all of them while only one is needed? This creates the impression that all the patches selected needs to be applyed and, by my experience, this is not true.

The wizard should recongnize which level of database it is dealing with and adjust the patches selected consequently.

With the procedure mentioned above, I had e message error however.
It was related to collation (which I do not know what it is) value set in counter history table.
I changed that value copying it from my 138 database and the upgrade was run to the end. Another error message appeared but the wizard says that it can be ignored and so I did.

Now by info server my db is 139 and by admin page the zen cart version is 139.
But believe me I spent two working days figuring out how to do it.

I really think that some correction should be made to the instructions and to the wizard.
ciao
enzo

19 Jul 2010, 1:04 PM
#14
drbyte avatar

drbyte

Sensei

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

Post #14 by drbyte

enzo-ita:

Here there is another problem with the wizard. Why it select many pathces and not all of them while only one is needed? This creates the impression that all the patches selected needs to be applyed and, by my experience, this is not true.

The wizard should recongnize which level of database it is dealing with and adjust the patches selected consequently.The "wizard" as you call it actually does very specifically check for each upgrade stage, based on a number of factors, and only pre-checks the boxes for the steps where it finds things missing.

If it's checking boxes for stages that you think are already done, then you've done some significant changing to your database, making it very non-standard, in which case there is no way to accurately "guess" because you've removed the markers by which it judges the steps to be done.

It's unfortunate that your unique upgrade has given you so much trouble. At least now you've completed one, and thus the next one will be easier.

.
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.

19 Jul 2010, 1:48 PM
#15
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #15 by enzo_ita

Said that I like zen cart and that I will always thank who created and support it, becasue this allowed me to start up a business, I have to say that there are some problems with it.

I have not mod my db, I just added using the patches some add on downloaded from zen cart.
I never ventured in doing mods to the db. I am too scared about.

Howevre, if you start an install form scrath following all the steps including the load of the samples data, and then you run zc_install, it will propose you to appy patches to db and this seems weird to me.

Why a db freshly created should be patched?

Well, it may be it is becasue I am using a italian version I do not know and do not think this should be allowed to happen.

Ciao from Italy

19 Jul 2010, 2:27 PM
#16
drbyte avatar

drbyte

Sensei

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

Post #16 by drbyte

I believe the problem is with your unofficial italian version which was NOT produced by the Zen Cart developers. It was modified by someone else, and you should be approaching them for technical support on the problems you are having with using their version.

.
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.

19 Jul 2010, 6:03 PM
#17
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Post #17 by enzo_ita

Yes, It may be but unfortunately the italian support forum is far from being responsive particularly to newbie like me.
Is there any way I could install the original verision importing all my data form my actual db?
I have seen in dwld thta there is a the possibility to installa the italian translation so this should not be a problem neither affect the original version. Right?
Thanks for your help.
enzo