Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

    Default Updating 155f to 157b, Database tables empty

    157b, xampp testsite, no plugins, standard responsive classic template.

    I copied the 157b files to xampp, created the new db by importing my 155f db which contains data back for 7 years.
    I checked the new db and all the tables and data are there; I copied the db to a new db for backup using PHPMyAdmin.

    After I run zc_install everything seems fine. I can log in to admin and start the storefront.
    The problem is the 157db, all my tables are in my 157b db but many are now empty - no data in tables like customers, products.
    For example, Table querybuilder has the standard queries but not the queries I wrote myself

    I tried to run zc_install again by copying the zc_install folder into xampp but when I try to start zc_install I immediately get a fatal error message, no chance to click on "upgrade".
    From logs
    Code:
    PHP Fatal error: 1146:Table 'zencart157btest.plugin_control' doesn't exist :: UPDATE plugin_control SET infs = 0 ==> (as called by) C:\xampp73a\htdocs\Zencart157b\catalog\includes\classes\PluginManager.php on line 199 <== in C:\xampp73a\htdocs\Zencart157b\catalog\includes\classes\db\mysql\query_factory.php on line 170.
    No other error messages in logs.

    The table zencart157btest.plugin_control does exist in the 157b db with one row with author "Vinos de Frutas Tropicales (lat9)", my 155f db does not have this table.


    Usually, such problems in basic things are from me doing something dumb`

    Thanks for any help.

  2. #2
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

    Default Re: Updating 155f to 157b, Database tables empty

    BTW, I am using xampp 3.2.4, PHP7.3.9

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Updating 155f to 157b, Database tables empty

    Three possibilities come to mind without further info:

    - I wouldn't have expected zc_install to access those plugin tables at all. So, it sounds like you're not hitting /zc_install/index.php but rather just the "root" of the site, which would be your storefront ... which will definitely complain if it's missing those essential tables.

    - perhaps your "import" of 155 into 157 left some of your initial 157 tables behind, but the upgrade-detector erroneously sees it as already up-to-date, so isn't offering an upgrade option. Suggest deleting the 157 database and re-making it and re-linking the db credentials to it, before importing the 155 data into it.

    - perhaps after you imported your 155 db and ran zc_install maybe you clicked "Clean Install" instead of "Upgrade", so it wiped out a lot of what you imported. Clearing the old temporary 157 tables and re-importing 155 data would be the steps to take here.
    .

    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 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

    Default Re: Updating 155f to 157b, Database tables empty

    Quote Originally Posted by DrByte View Post
    Three possibilities come to mind without further info:

    - I wouldn't have expected zc_install to access those plugin tables at all. So, it sounds like you're not hitting /zc_install/index.php but rather just the "root" of the site, which would be your storefront ... which will definitely complain if it's missing those essential tables.

    - perhaps your "import" of 155 into 157 left some of your initial 157 tables behind, but the upgrade-detector erroneously sees it as already up-to-date, so isn't offering an upgrade option. Suggest deleting the 157 database and re-making it and re-linking the db credentials to it, before importing the 155 data into it.

    - perhaps after you imported your 155 db and ran zc_install maybe you clicked "Clean Install" instead of "Upgrade", so it wiped out a lot of what you imported. Clearing the old temporary 157 tables and re-importing 155 data would be the steps to take here.
    Thanks for your quick and helpful reply.
    You are correct I missed the index.php.

    I fixed the db as follows.
    I ran zc_install and created an empty 157db.
    Then using PHPmyadmin I imported my 155f db
    Then I ran zc_install/index.php, I had to login using the 155f Super user.
    Using "upgrade" it upgraded 155 to 156 and then to 157.
    Now the db seems to be OK with all my data prsent.

  5. #5
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

    Default Re: Updating 155f to 157b, Database tables empty

    When I tried to look at my customer list I had a failure
    Code:
    PHP Fatal error: 1054:Unknown column 'c.customers_secret' in 'field list'
    I ran this SQL and fixed the problem
    Code:
    ALTER TABLE customers ADD COLUMN customers_secret VARCHAR(16);
    Was that a good idea?
    Last edited by marton_1; 5 Dec 2020 at 02:19 PM. Reason: spelling

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Updating 155f to 157b, Database tables empty

    The upgrade script should have handled that.
    Did it log any other failed db changes when the upgrade ran? Logs dir. zc_install in the filenames.
    .

    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. #7
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

    Default Re: Updating 155f to 157b, Database tables empty

    Thanks for the quick answer, just this in logs (did not know there are zc_install logs)
    Code:
    [04-Dec-2020 14:32:27 Europe/Berlin] MySQL error 1292 encountered during zc_install:
    Incorrect datetime value: '0000-00-00 00:00:00' for column `zencart157btest`.`customers`.`gdpr_accept_date` at row 1
    ALTER TABLE customers ADD customers_secret varchar(64) NOT NULL default '';
    As you know this the EU General-Data-Protection-Rules-GDPR plugin is from JSWeb so not part of the basic zen cart.

    I deleted the column I added and ran your "ALTER TABLE" SQL.
    It inserted new customers_secret column OK but a load of warnings "Warning: #1264 Out of range value for column 'gdpr_accept_date' at row 1
    "

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Updating 155f to 157b, Database tables empty

    Ya, it looks like that jsweb thing is based on old ways of handling dates, and only built for old MySQL versions not using strict-mode.

    You may need to find all those old custom-added date fields and change the old data in them first.
    You can't do any table schema alterations until the invalid data is fixed.

    We do a bunch of these this way in core code: https://github.com/zencart/zencart/b...es_cleanup.sql You can use that as inspiration for the changes you may need to make to any fields you've added to any of your tables.
    You probably also need to change the field's "default" value to a non-zero date.

    You'll probably also need to update whatever PHP code inserts data into those fields so that it never uses zero-dates either.

    Additional reading: https://docs.zen-cart.com/user/upgra...andardization/
    Last edited by DrByte; 14 Mar 2021 at 09:40 PM. Reason: Updated links
    .

    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. #9
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

    Default Re: Updating 155f to 157b, Database tables empty

    Quote Originally Posted by DrByte View Post
    Ya, it looks like that jsweb thing is based on old ways of handling dates, and only built for old MySQL versions not using strict-mode.

    You may need to find all those old custom-added date fields and change the old data in them first.
    You can't do any table schema alterations until the invalid data is fixed.
    Sorry for the late reply, this default setting and code update worked fine.
    I did not find anything in the PHP code that inserts data into those fields that insert zero-dates.
    I have now put an update in the GDPR thread

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Updating 155f to 157b, Database tables empty

    I've updated the links in my post with more information learned since I made those comments.
    .

    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. Database - Updating new database with old database info
    By J9MM0 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Feb 2020, 11:45 AM
  2. v155 155f to 156a upgrade: database changes?
    By acmaurer in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 13 Mar 2019, 05:37 AM
  3. v139h database upgrade on 139h to 155f
    By willweC in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 18 Jun 2018, 03:07 AM
  4. v155 sidebars gone when old database imported on new 1click install zencart 155f. Any fix?
    By turuga in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 May 2018, 06:37 AM
  5. Create Database, Tables and Drop Database or Tables
    By elwood cordery in forum General Questions
    Replies: 3
    Last Post: 17 Aug 2009, 04:03 PM

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