Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Database problems after move and upgrade

    I did exactly what ZenCart warned me not to do here:
    http://www.zen-cart.com/content.php?...fferent-server

    The previous database (1.3.9) contained over 10,000 orders. The current database (moved from the old host, upgraded to 1.5.4) is not properly recording new orders. I get the following error in the logs:
    PHP Fatal error: 1062uplicate entry '0' for key 'PRIMARY' :: INSERT INTO zen_orders

    It appears that a new entry into orders_id is not being generated. The first order after the move was assigned orders_id 0 (zero) for the following tables (but not orders_id):
    orders
    orders_products
    orders_products_attributes
    orders_status_history
    orders_total

    I doubt there is a simple fix to this problem. That being said, might I want to start the order history over (dropping table info)? Or would that just make matters worse.

    I'm willing to take any advice to fix (and scolding for doing what should not have been done).

    Thanks in advance,

    Sean
    +<|:-)

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,151
    Plugin Contributions
    11

    Default Re: Database problems after move and upgrade

    There's just a LOT more we need to know in order to help. It's like you've told us you have a car and it won't run.
    The posting tips are there to let you know that everything you can tell us about the situation (even if you think it doesn't apply) might just get a quick, spot on response.

    A WAG would be that you did not properly import the old database. Please resist any drastic changes until you give us more information. If you still have backups from the old server, the fix might be quite simple. Hopefully, step six of the link you posted will help BUT, let's wait till we know more.

    A properly upgraded site would not have these problems.

  3. #3
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Database problems after move and upgrade

    What version of Zen Cart are you using? 1.5.4
    Has your site been upgraded? When? From what version(s)? Just upgraded from 1.3.9
    If you've upgraded, HOW did you upgrade? (official upgrade procedure or an automated script from your hosting company?) Tried to follow the upgrade procedure. Looks like I might have had problems importing the old database.
    What plugins/addons have you installed? When? If your problems are payment-related, what payment module(s) are you using? If it's shipping-related, which shipping module(s) are you using? I have installed the following plugins:
    CEON URI Mapping
    FedEx Express/Ground (not activated)
    Referral (How did you find us)
    If your problems are language-pack related (non-English), have you checked that all the language files are loaded and correct? The problem is both in English and Spanish
    HOW did you install Zen Cart? (upload via FTP and run zc_install, or a one-click install from your hosting company? (one-click installs might mean you don't have enough information about your site/server to make customizations easily)) I uploaded via FTP. Exported/Imported database using phpMyAdmin. The database was too large to import normally, so I used MySQL Workbench
    What version of PHP and MySQL is your server using? (See Admin->Tools->Server Info) PHP is 5.4.37 MySQL is 5.5.41-cll-lve
    WHEN did the problem "start"? How does that compare with other events of your hosting company, changes you've made to your site files/addons, or your admin settings, etc? Problem occurred on first order and evey order since then
    Please post the contents of related "debug logs" generated by Zen Cart (wrap the content in
    Code:
     and
    tags please!).
    PHP Fatal error: 1062uplicate entry '0' for key 'PRIMARY' :: INSERT INTO zen_orders
    ==> (as called by) /home/urbanherbguy583/public_html/store/includes/functions/functions_general.php on line 965 <== in /home/urbanherbguy583/public_html/store/includes/classes/db/mysql/query_factory.php on line 155

    If this is your first store, have you tested all aspects of transactions before going live? Moved the store, not my first store.
    In what ways is your site customized or different from a brand new uncustomized install? Customized Template files, though these seem to be working fine.
    Please post your site URL* so we can take a look at it. This is especially important if you're encountering display/layout problems, so the problem can be seen directly.
    https://herbsofmexico.com/store/
    If you're encountering problems that could be related to your server or hosting company, include the name of your hosting company (not their URL). GoDaddy (moved from HostGator)
    HAVE YOU LOOKED IN THE FAQ AREA for answers to your question? (ie: a search for your error message or what you want to edit/change, etc) Answer is not in the FAQ
    Have you searched the FORUM for your error message or for answers to the question you're asking?
    Answer is not in the forum (as far as I could find).

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,151
    Plugin Contributions
    11

    Default Re: Database problems after move and upgrade

    The mistake may have been changing the order ID to 0 and leaving in the old orders. Can you check the database and change the order ID to the next hundred from the largest currently. i.e., If it is 962, change the new id to 1000. Let's see if that helps.

  5. #5
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Database problems after move and upgrade

    I never changed the ID to 0. In fact, once I saw there was a problem with the ID, I went into Admin and changed the order number to 20,000 (we had 10,000 orders previously). That didn't fix the problem either. Now there are orders with orders_id 0, but no new orders are coming in at 20,000+.

  6. #6
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Database problems after move and upgrade

    We are willing to spend money to fix this problem. Please contact me if you think you can help.

  7. #7
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Database problems after move and upgrade

    Don't know what I should do.

  8. #8
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Database problems after move and upgrade

    If I drop all of the records from the orders table, what other tables will be affected?

  9. #9
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Database problems after move and upgrade

    Quote Originally Posted by TKPope View Post
    If I drop all of the records from the orders table, what other tables will be affected?
    That's a dangerous thing to do unless you really know what you are doing and know how to recover if/when things go (even more) belly up than they already are.

    To answer the question though.

    This may not be a complete list. I obtained it from
    http://www.zen-cart.com/wiki/index.p...atabase_Schema and have no idea how often or when this was last updated.
    Order History

    files_uploadedorders *orders_products *orders_products_attributes *orders_products_download *orders_status_historyorders_total *and
    paypal *paypal_payment_status_history *paypal_session *



    Cheers
    RodG

  10. #10
    Join Date
    Jul 2009
    Posts
    37
    Plugin Contributions
    0

    Default Re: Database problems after move and upgrade

    Rod - I appreciate the response. It may be dangerous, but I currently have a site that's not working. I don't know what to do, and I don't know if that will fix the problem. All of the data (good and bad) is backed up, so it's at least something that might be worth trying to see if that works.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. no database after server move
    By skipper_2 in forum Installing on a Linux/Unix Server
    Replies: 15
    Last Post: 10 Jan 2011, 06:17 PM
  2. 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
  3. database upgrade problems
    By ridelow in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 10 Oct 2008, 04:53 PM
  4. database upgrade problems
    By keystonewebworks in forum General Questions
    Replies: 0
    Last Post: 13 Oct 2006, 02:44 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