Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Posts
    9
    Plugin Contributions
    0

    red flag Help! Cannot upgrade database MySQL errors

    Originally I was using 1.3.7 and just upgraded to 1.3.8.
    MySql client version 4.1.22
    phpmyadmin 2.11.9.4

    After upgrading the files, I got an error that the database needed patching, so I installed the "new" database and tried to import the data from the old one.

    I had to ask my webhost to complete the import because the operation kept timing out for me. But when I give them the file from which to load the data only, they get the following error message:

    ERROR 1062 (23000) at line 50: Duplicate entry '1' for key 1

    Where do I find "Line 50"? Is this a sequential line starting from table 1? If I compare the two databases in WinMerge, line 50 refers to the structure line of the address_book table and in further comparison, there are no changes, no visible errors in either file. So could the problem be?

    Thinking it would be easier just to change the structure of the old database manually, I started working on making those changes, but I cannot find a way to change the auto-increment amount. Does anyone know how to do this?

    Will the old database continue to work without the "patches"? If so, how do I get rid of the message at the top of the page that says the database needs patching?

    Sorry if I sound frustrated but my site's been down a week trying to get this situation resolved. Last resort, I'll have to manually upload all my old information into the new database, I guess, unless someone can help me resolve this.

    Sandra Dugas

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help! Cannot upgrade database MySQL errors

    Quote Originally Posted by starmakersandy View Post
    But when I give them the file from which to load the data only, they get the following error message:

    ERROR 1062 (23000) at line 50: Duplicate entry '1' for key 1
    That's very common if you already have data in the database. Basically you're trying to load the same data as new records in a table that's already got records in it which have an auto_increment ID already set.
    You can't do that.

    You should either delete all the existing data *before* importing a data-only SQL file, or you should include structure-and-data, having it wipe and recreate the tables as it goes along.
    Quote Originally Posted by starmakersandy View Post
    Where do I find "Line 50"? Is this a sequential line starting from table 1?
    No, it's line 50 in the SQL statement that it was processing when the error occurred. It's likely part of a compound INSERT statement where it's trying to insert multiple records.



    Sounds like you've been hacking things together.
    Normally one should do their upgrade on a TEST copy of their site first, so they know what issues they might run into and can work out resolutions to those situations before going and doing the upgrade to the actual live site.

    Thus, this is what I would do (paraphrased from the existing upgrade documentation):
    - make a complete backup of all files and database from your live site
    - use that backup to install that same site onto a new folder/domain and new database (making appropriate adjustments to the 2 configure.php files for new paths/database details)
    - test that the TEST site now works
    - now upgrade all the PHP files on the TEST site using WinMerge etc to handle all customizations carefully
    - now upgrade the TEST database using zc_install (which you would upload as part of the updated set of PHP files)
    - test that the TEST site is functioning correctly
    - Resolve all problems which occur, making notes so you can quickly fix those issues when you repeat the process on the live site.
    - When satisfied that the TEST site is good, repeat on the live site:
    - upgrade all PHP files
    - upgrade database
    - test
    .

    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.

 

 

Similar Threads

  1. v154 upgrade database errors.
    By Joseph Heinen in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 21 Nov 2015, 08:21 PM
  2. Text errors in database upgrade 1.3.8a to 1.3.9g
    By Mom0fgirls in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 15 Oct 2010, 05:09 AM
  3. MYSQL Upgrade, now getting errors on mods
    By netchaos in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2009, 10:19 PM
  4. help with mysql database on store upgrade/move
    By kinget in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 28 Oct 2008, 12:11 PM
  5. running 1.3.0 MySQL Database errors
    By Noella in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 15 Sep 2006, 06:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR