Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Mar 2007
    Location
    Worcester UK
    Posts
    138
    Plugin Contributions
    0

    Default Upgrade database -- but it still shows pre-import data

    I want to import a database which was backed up from the 1.3.9f site into a 1.5.3 site on a subfolder.

    http://rarecoinsandtokens.co.uk/zencart15/index.php

    The installation 1.5.3 installation was done with Softaculous.
    Which created and named the dbase and pwd, and created the config files.
    All worked ok.
    I made one test product.
    I now want to get the 1.5.3 copy on the subfolder loaded with the 1.3.9f database.

    In site cPanel MySQL Databases, I have assigned a user to match the config files.

    Using phpMyAdmin, I have navigated to the database named in the config files, and imported the data from the 1.3.9f database zip.

    I have then uploaded a copy of zcinstall folder, (since it was deleted by Softaculous to get the new 1.5.3 store running),
    and ran the install to the point where it offeres upgrade database.
    I have selected that option, and it appeared to work, and invited me to visit the site after renaming admin, and deleting zcinstall folder.

    However, the site still shows pre import data.
    I have checked the config files, and they seem to have correct paths and names etc. although I have read elsewhere that this is not relevant when using zcinstall to upgrade the database.

    I would really appreciate some help with this, since the first upgrade left me without image enlargement functioning on the live site.
    http://rarecoinsandtokens.co.uk/
    so I need to get this working

    Thanks.


    (PS I have read several threads, but none which help.
    Also, I used Softaculous because my previous manual uploads resulted in the enlargement failure on the live site,
    and I wanted to eliminate path errors in the config files which may be causing my live site to stumble.)



    SUBFOLDER INSTALL DETAILS
    http://rarecoinsandtokens.co.uk/zencart15/index.php
    Zen Cart 1.5.3
    Database Patch Level: 1.5.3
    PHP Version: 5.4.28 (Zend: 2.4.0) PHP Memory Limit: 128M

    Database: MySQL 5.5.40-cll


    GD Support enabled
    GD Version bundled (2.1.0 compatible)
    Server Host: enterprise.terrassl.net (212.113.134.236) Database Host: localhost (127.0.0.1)
    Server OS: Linux 2.6.18-448.16.1.el5.lve0.8.70
    kevin_a

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Upgrade database problem.

    When comparing the includes/configure.php files between your old site and new site, and looking specifically at the database prefix, is the prefix the same on both sites?
    Further, aspart of importing the old data, it sounds like the new data tables were not dropped, otherwise there would not be "pre-import" data available to see. Dropping the tables is part of the database upgrade/import. See: http://www.zen-cart.com/entry.php?3-...d-of-upgrading
    For some further guidance.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Mar 2007
    Location
    Worcester UK
    Posts
    138
    Plugin Contributions
    0

    Default Re: Upgrade database problem.

    Thanks for the reply.
    I recall specifying that the tables be dropped.
    What are the consequences of not doing so?


    The 1.3.9f database has this in the config

    define('DB_DATABASE', 'millenni_db1');


    The 1.5.3 database has this in the config

    define('DB_DATABASE', 'millenni_zenc15');

    Thankyou
    kevin_a

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

    Default Re: Upgrade database problem.

    Out-of-the-box, Zen Cart names its database tables like this:
    - admin
    - customers
    - categories
    - products
    - etc

    But done that way only 1 store could be in any 1 database.
    Some customers' hosting companies are cheap and allow only 1 database for the entire account, which makes it difficult to run multiple sites or other applications.
    So, Zen Cart added the ability to "add a prefix to all the tablenames". Often this is done as "zen_", but some hosts do differently.

    Using "zen_" as the prefix, the tablenames would become something like:
    - zen_admin
    - zen_customers
    - zen_categories
    - zen_products
    etc


    In your configure.php files you'll see a define for DB_PREFIX. You'll need to copy the same DB_PREFIX setting from your old configure.php into your new ones, else your new one won't know how to find the properly-named tables that you're importing from the old database.

    NOTE: DB_PREFIX is NOT the DB_DATABASE setting that you just posted.
    .

    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.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Upgrade database problem.

    Quote Originally Posted by kevin_a View Post
    Thanks for the reply.
    I recall specifying that the tables be dropped.
    What are the consequences of not doing so?


    The 1.3.9f database has this in the config

    define('DB_DATABASE', 'millenni_db1');


    The 1.5.3 database has this in the config

    define('DB_DATABASE', 'millenni_zenc15');

    Thankyou
    I saw Dr. Byte's response, so not going to duplicate that discussion. One thing that I've seen when I have accidentally forgotten to drop the tables before uploading (didn't make total sense either) was that there was no error in the upload of the "new" database, but the data didn't make it and it looked as if I hadn't done anything... Took a step back and realized my mistake of not dropping the tables in advance of uploading the replacement table(s).

    Btw, having seen about the issues you've had, in the zc_install file set that was uploaded, have you applied the patch(es) described in: http://www.zen-cart.com/showthread.p...s)-with-v1-5-3

    That is before you lose your patience with this process as well, which btw, if you hadn't seen, and somewhat sorry to say, 1.5.4 was released today which doesn't require the patches for the install/upgrade (since they're already included).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Mar 2007
    Location
    Worcester UK
    Posts
    138
    Plugin Contributions
    0

    Default Re: Upgrade database problem.

    Quote Originally Posted by mc12345678 View Post
    I saw Dr. Byte's response, so not going to duplicate that discussion. One thing that I've seen when I have accidentally forgotten to drop the tables before uploading (didn't make total sense either) was that there was no error in the upload of the "new" database, but the data didn't make it and it looked as if I hadn't done anything... Took a step back and realized my mistake of not dropping the tables in advance of uploading the replacement table(s).

    Btw, having seen about the issues you've had, in the zc_install file set that was uploaded, have you applied the patch(es) described in: http://www.zen-cart.com/showthread.p...s)-with-v1-5-3

    That is before you lose your patience with this process as well, which btw, if you hadn't seen, and somewhat sorry to say, 1.5.4 was released today which doesn't require the patches for the install/upgrade (since they're already included).

    Thank you for the replies..

    I have checked the config files for a prefix to the database, and found that the 1.5.3 config files had zen_ prefix, and the original config did not.
    So I have removed the prefix in this line.......... define('DB_PREFIX', ' ');
    and the store now shows the data as imported.
    However..regarding the buggy zc_install package,

    I have uploaded the file... /zc_install/includes/functions/general.php

    then added the code...
    //KA added as DrByte advised to general.php
    define('DIR_FS_CATALOG', zen_read_config_value('DIR_FS_CATALOG', FALSE));
    define('DIR_WS_CLASSES', 'includes/classes/');


    BUT
    navigating to find the /includes/classes/class.zcPassword.php for the other edit, it does not show in the folder.
    there are 3 files in the /classes folder.

    class.installer_version_manager.php
    installer.php
    message_stack.php

    class.zcPassword.php
    is not there.


    the error message, when I try to run zcinstall to upgrade the dBase because admin log in is asking for that to be done, is
    "Admin Password required to proceed with upgrade more info..."

    How might I proceed from here please?
    kevin_a

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

    Default Re: Upgrade database problem.

    Quote Originally Posted by kevin_a View Post
    Thank you for the replies..

    I have checked the config files for a prefix to the database, and found that the 1.5.3 config files had zen_ prefix, and the original config did not.
    So I have removed the prefix in this line.......... define('DB_PREFIX', ' ');
    and the store now shows the data as imported.
    Great!

    Quote Originally Posted by kevin_a View Post
    However..regarding the buggy zc_install package,

    I have uploaded the file... /zc_install/includes/functions/general.php

    then added the code...
    //KA added as DrByte advised to general.php
    define('DIR_FS_CATALOG', zen_read_config_value('DIR_FS_CATALOG', FALSE));
    define('DIR_WS_CLASSES', 'includes/classes/');


    BUT
    navigating to find the /includes/classes/class.zcPassword.php for the other edit, it does not show in the folder.
    there are 3 files in the /classes folder.

    class.installer_version_manager.php
    installer.php
    message_stack.php

    class.zcPassword.php
    is not there.


    the error message, when I try to run zcinstall to upgrade the dBase because admin log in is asking for that to be done, is
    "Admin Password required to proceed with upgrade more info..."

    How might I proceed from here please?
    I know you've just got your head around doing the 1.5.3 upgrade, but I want to mention that v1.5.4 has just been released and these class.zcPassword bugs are fixed in it, so no edits are required.

    May I suggest that you go to v1.5.4 while you've got this stuff all open?
    It's actually simple:
    a) just replace the changed files ... ie: the ones changed between 153 to 154. There's a complete list of them in the /docs/changed_files_1.5.4.html file.
    b) then run the 154 zc_install
    .

    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.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Upgrade database problem.

    So, to be sure, when looking for the includes/classes/class.zcPassword.php file you are looking in the store path and not in the zc_install path correct?

    If that file is not there, then it is because of not using the downloaded version of ZC available from http://www.zen-cart.com/getit

    In my opinion you won't like the suggestion... Which would be to follow the process/guidelines of http://www.zen-cart.com/entry.php?3-...d-of-upgrading using the "new" files. As for why the "previous" upgrade attempt caused issues, well, it appears that this is the first time that ZC has been installed ina subdirectory and thus leads one to think that the previous upgrade was done in place without a "substitute" or temporary system in place... Therefore, it also would seem that one or more files were either incorrectly updated, omitted, or left as extras... Hopefully you have some form of file comparison utility such as winmerge or beyond compare... Something that performs directory as well as specific file comparisons.

    Anyways, such a utility could be used to identify what else is different between the softaculous install and an install that would have been performed using an official copy of the ZC software.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Mar 2007
    Location
    Worcester UK
    Posts
    138
    Plugin Contributions
    0

    Default Re: Upgrade database problem.

    Quote Originally Posted by mc12345678 View Post
    So, to be sure, when looking for the includes/classes/class.zcPassword.php file you are looking in the store path and not in the zc_install path correct?

    If that file is not there, then it is because of not using the downloaded version of ZC available from http://www.zen-cart.com/getit
    Following the logic of DrBytes suggestion lead me along this path

    3. Apply the additional fix in posts #8 , #9 below.
    #8
    SOLUTION:
    Edit /zc_install/includes/functions/general.php
    After the opening <?php line, add the following:
    Code:
    define('DIR_FS_CATALOG', zen_read_config_value('DIR_FS_CATALOG', FALSE));
    define('DIR_WS_CLASSES', 'includes/classes/');

    #9
    Another change which appears to help address the admin-password-rejected-during-database-upgrade issue is:

    Edit /includes/classes/class.zcPassword.php
    Around line 49 you have this:
    if (version_compare($phpVersion, '5.3.7', '<')) {
    etc

    Since post 9 was sequential to #8 ("another change"), and doesn’t further qualify to admin ‘includes’, and the issue is with the zc_install, I saw no reason to search for other possibilities.
    I have now found the file, and edited as recommended, but zc_install reports "password required" even when password is in the text field. It bumps me back to the top.
    But Thank you for the pointer.

    Quote Originally Posted by mc12345678 View Post
    In my opinion you won't like the suggestion... Which would be to follow the process/guidelines of http://www.zen-cart.com/entry.php?3-...d-of-upgrading using the "new" files. As for why the "previous" upgrade attempt caused issues, well, it appears that this is the first time that ZC has been installed ina subdirectory and thus leads one to think that the previous upgrade was done in place without a "substitute" or temporary system in place... Therefore, it also would seem that one or more files were either incorrectly updated, omitted, or left as extras... Hopefully you have some form of file comparison utility such as winmerge or beyond compare... Something that performs directory as well as specific file comparisons.
    Anyways, such a utility could be used to identify what else is different between the softaculous install and an install that would have been performed using an official copy of the ZC software.


    I note your observation
    "In my opinion you won't like the suggestion... Which would be to follow the process/guidelines of http://www.zen-cart.com/entry.php?3-...d-of-upgrading"


    Can you believe I did this route first of all, using a copy of 1.5.0, got it working in the subdirectory. When I replaced the 1.3.9 with files from the 1.5.0, which worked in the subdirectory, I got the problem with image enlargement which initiated this whole episode.

    This is the live site as it is now, malfunctioning from the transfer from sub to public_html directory.
    http://www.rarecoinsandtokens.co.uk/

    If I could get this version working I would be happy.


    So I have now done a complete 1.5.0 build in a subdirectory using my own 1.5.0 downloaded file installation, following that which you suggest I follow,ie http://www.zen-cart.com/entry.php?3-...d-of-upgrading" which worked up to the point of moving from sub to public, and which exists with problems


    I have then built another version of the site based on 1.5.3, and although Softaculous was used to ensure paths were correct etc.,(perhaps that was an issue with the first attempt).
    The 1.5.3 site is actually VERY simple, has no add ons besides CKeditor, and only needs template and minor settings to display.
    I cant believe Softaculous would screw that up.
    http://rarecoinsandtokens.co.uk/zencart15/
    This version I have advanced to password problem stage accessing admin.

    Since neither of these installations is recoverable?, am I to understand that the present optimum solution, for this simple site, is another however many hours which might sort it out, by creating yet another version with another database in a subfolder based on 1.5.4 uploaded files (not softaculous), which has only just come out, and has yet to be tested by users?
    My confidence is waning to the negative.
    But if none come forward willing to help with the previous installations, then I have no option really.

    One instruction that initially causes me concern is
    "Replace all the Zen Cart php files/folders/images/everything in your live store with the new files (except the configure.php files which usually stay the same)"
    That seems to be suggesting that the old 1.3.9. config files will drive the 1.5.* installation. I anticipate confusion.
    In my case it would be the 1.5.0 config files which now inhabit the front end of the faulty site.
    Can I clarify this issue?
    Thanks.
    kevin_a

  10. #10
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Upgrade database problem.

    So, now that you have described the process that was used to result in the faulty initial installation, the situation is quite clear....

    The only upgrades that I believe I have recently seen where it is possible to simply "replace" the files has been basically 1.5.1 to 1.5.3 or (as a result of what I believe I have read about) 1.5.4. As to the "usage" of 1.5.4, it has undergone some rather extensive testing by others that do these types of things with ZC. Yes, 1.5.3 had some upgrading issues, but 1.5.3 was something of an emergency distribution as PHP 5.4 was pretty much on everyone's doorsteps... A clean install worked fine, it wasn't until later that some upgrade paths seemed to cause issues.

    So, anyways, the point being that, merely writing all of the 1.5.3 files to the 1.3.9 directory is not all that is necessary, there are also files that are/were in 1.3.9 that are no longer in 1.5.3 and need to be removed... Further... template files need to be compared to the default version(s) of the files and "upgraded" as well.. They lie outside of the ZC core files, but are just as influential as any default file is. Thing is, as long as the default and/or core files are intact, then it is possible to switch templates back to the original/core templates and validate functionality of the store. If the problem continues to exist in that condition than there is something wrong with something more "basic" (core-like), and that's another time to compare the files of the store with a default (unaltered) installation.

    Umm, real quick, said above that the file was found, but in the discussion also stated something about addressing the admin 'includes'... The modifications provided in that thread to address upgrading do not touch any of the admin files. In fact, when performing a database upgrade (and I learned this a couple months back) the admin directory is not even a factor in the upgrade. It can stay named as it always is/was in support of site operation. It does not require renaming or anything. So, hopefully the mod(s) were applied to either the zc_install directory or to the includes directory and not anything with the admin directory.

    So, back on the 1.5.0 version of the site, if you go a step further with the comparison of the configure.php files and actually take a look at the content... You should see several lines such as define('HTTP_HOST', 'your-host-here-as-an-example');
    When looking at one to the other, basically they have the same defines, correct? There are a few new ones in 1.5.x or they change slightly, for example the path to log errors changes in ZC 1.5.1... Anyways, as is stated, the things change very little in the configure.php files.. In your case the 1.5.0 configure.php file paths all include the sub-directory, where as the 1.3.x version(s) do not... And the database is different. But, all that said, the other aspects of the 1.5.0 configure.php file(s) can be brought over to the "new" location...

    Does any of that make sense? I have an understanding of the process and information, but am not sure what it is that is not understood. Yes that line can be disconcerting, but when a step is taken back... For the most part it is as stated, pretty much the same... And whatever is "missing" can be added/altered after the site is confirmed to be functional.

    As far as database like stuff... You could use the database credentials from either of the previous unsuccessful installs and go from there. No need to go create yet another database... Afterall in the upgrade process, technically the database gets cleared anyways to just a username, password, and database name after all the tables are dropped.. :) So really all you would do is follow the instructions of ZC 1.5.4 install (I hesitate to incorrectly state what the specific instruction is) for an upgrade from 1.5.3 (which I thought was to upload all the new files of 1.5.4 onto the existing 1.5.3 files if no changes had been made to certain files in the installation instructions), and since 1.5.4 has its own database upgrade path/instruction, then again the database from the old version can be imported, zc_install run and the database upgraded...

    Remember, any files that are renamed so as not to "interfere" with changes are not to end in .php. Files in certain directories that exist with the extension .php are automatically loaded and will more than likely cause problems. Such files being changed/renamed should also not end in .old or .bak for PCI purposes.. Beyond that, only files that are necessary for site operation should remain on the server. So, if a file is temporarily renamed for testing purposes it should be removed as soon as possible.

    Help? And the reason I said in my opinion you wouldn't like the suggestion was because I have seen through your several threads now the frustration that has been experienced, that also could be avoided...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. I import database but still no details show
    By icklebits in forum Upgrading from 1.3.x to 1.3.9
    Replies: 18
    Last Post: 7 Jun 2007, 12:56 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