Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Posts
    138
    Plugin Contributions
    0

    Default Database upgrade failing

    Going from 1.3.7 to 1.3.8.

    I did a test database upgrade on a restored DB from earlier today and everything went great. I then deleted the DB and install files, re-uploaded so that everything was by the books and now I get this error.

    1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
    in:
    [INSERT INTO zen_query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');]
    I can delete the DB and files, recreate them, and keep the same error. I don't understand why it worked once but I can't get it to work again. Any ideas?

  2. #2
    Join Date
    Apr 2007
    Posts
    138
    Plugin Contributions
    0

    Default Re: Database upgrade failing

    I swear things are weird tonight. After this error, I went into the admin section and it said I needed to upgrade the DB. I checked the server info and sure enough, it said DB 1.3.7. So I dumped everything and started from scratch, got the same error again, went into the admin section and everything looks fine. I really wish I knew what was going on here. It looks like everything is working, but I feel a little uneasy about it.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Database upgrade failing

    Quote Originally Posted by swingandmiss View Post
    1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
    You'll only get that message if you're trying to upgrade a database that's already had the upgrade run on it at least once.

    If you want to skip ever getting that error, you'll have to remove it from the upgrade script:
    edit /zc_install/sql/mysql_upgrade_zencart_137_to_138.sql
    find the line (around 62)that says the following, and add the # at the beginning, as show:
    Code:
    #audience list addition: customers who have signed up but never made a purchase
    #INSERT INTO query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN  TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');
    .

    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.

  4. #4
    Join Date
    Apr 2007
    Posts
    138
    Plugin Contributions
    0

    Default Re: Database upgrade failing

    I thought that may be the case, but it was most definitely a 1.3.7 database. Regardless, it seems to be working now. Thanks for the help.

 

 

Similar Threads

  1. v151 Upgrade from 1.3.9h to 1.5.1 - Attribute Controller Failing in Admin
    By handylabels in forum Upgrading to 1.5.x
    Replies: 13
    Last Post: 6 Jul 2014, 02:48 PM
  2. Guest Shopping Cart Failing After Upgrade
    By Youngblood in forum General Questions
    Replies: 5
    Last Post: 18 Jul 2011, 09:48 PM
  3. Connection to database failing during install
    By HP Sauce in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 22 Mar 2011, 06:48 PM
  4. 1.3.7 upgrade to 1.3.8 - database upgrade failing
    By hollygds in forum Upgrading from 1.3.x to 1.3.9
    Replies: 5
    Last Post: 29 Sep 2009, 02:53 PM
  5. Upgrade 1.3.6 -> 1.3.7 -> 1.3.8a failing on me
    By dhcernese in forum Upgrading from 1.3.x to 1.3.9
    Replies: 6
    Last Post: 17 Mar 2008, 11:21 PM

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