Results 1 to 10 of 24

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: renaming DB tables for compatibility?

    You can always run patches via phpMyAdmin... just remember to edit in the zen_ prefix where necessary... This will ONLY be on the table name, NOT the field names within a table.

    eg:
    products (table) becomes...

    zen_products (table)

    products_id (field so NO prefix)
    20 years a Zencart User

  2. #2
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default Re: renaming DB tables for compatibility?

    Quote Originally Posted by schoolboy View Post
    You can always run patches via phpMyAdmin... just remember to edit in the zen_ prefix where necessary... This will ONLY be on the table name, NOT the field names within a table.

    eg:
    products (table) becomes...

    zen_products (table)

    products_id (field so NO prefix)
    I could do that, I guess. Wouldn't it seem a better long-term fix, though, to strip out those prefixes from the DB? I don't even remember making them, let alone why I would do that, and they don't seem to be necessary.

    If that's not a good idea, though, I'll try to edit the patch file.

    Thanks.

    Edit: I just discovered another issue: under the Configuration menu, I now have a bunch of Zen Lightbox entries, presumably from the bad installation attempts. How do I get rid of those?
    Last edited by mzimmers; 26 Mar 2010 at 06:23 PM.

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: renaming DB tables for compatibility?

    As long as you will never need to put another program's database in the same container, I would agree with you. The prefix is necessary if you only are allowed one db and need to run two programs. A SQL expert would be helpful to give the complete process for removing the prefix.
    Manual install gives the option of defining a prefix, or choosing no prefix.

  4. #4
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default Re: renaming DB tables for compatibility?

    Aargh.

    My attempts to edit the patch file resulted in a different error. Now, when I upload the file, I get multiple occurrences of:

    ERROR: Cannot execute because table zen_configuration_group does not exist. CHECK PREFIXES!

    According to phpMyAdmin, it does indeed exist. I think I'm somewhere in limbo between ZC not expecting the prefix, and the patch requiring them.

    To add insult to injury, it creates a new table, zen_zen_ upgrade_exceptions, and puts the error messages in there.

    Glenn, I don't have a SQL expert here...how difficult is it to manually rename the tables? If I downloaded the DB, edited the file and removed all occurrences of "zen_" would that do it, or are there other instances of that text that need to remain? I can't see yet how to modify table names through phpMyAdmin.

    Thanks.

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: renaming DB tables for compatibility?

    That's why I suggested an expert... I might be able to muddle through it, but would not want to experiment on a live database. There should be ways within phpMyAdmin.

    Hopefully one will drop in here.

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: renaming DB tables for compatibility?

    Mike... lesson one... (I learned it the hard way)...

    Fiddle only with backup sites or test sites.

    I have just done a MAJOR overhaul of a very busy UK site (turning over in excess of £10,000 a day, with more than 10,000 products and 15,000 customers) and the FIRST thing I did was create a full CLONE of the site, port it all to my dev servers, and practice all my tweaking on that.

    One of the procedures involved changing all image file extensions from gif and bmp , to jpg (data digger helped me with the global sql command here). Another involved a full reassignment of product sort codes, using the category tree sort codes as base references. So if a product was sort code 112, and its category sort code was 44, and that category was inside another with a sort code of 27, then the PRODUCT sort code had to be a concatenation of 27, and 44, and 112 - to read 2744112.

    A myriad of PHP and SQL scripts were written to achieve this...

    Then we have to get all the bmp and gif images, resample them, save them as jpg, and then transfer everything to a NEW images folder.

    I am quite experienced at matters relating to ZC, but during our trials I made several fatal errors on the process and killed the cloned database 4 times.

    Did I worry? not a bit... I just dropped all the tables from the database and reinstalled it from the original sql dump.

    The whole project took 38 hours - but the live site wasn't touched until we were ABSOLUTELY sure that the cloned site worked flawlessly.

    Do your tinkering on a clone of your site...
    20 years a Zencart User

  7. #7
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default Re: renaming DB tables for compatibility?

    Point taken, Schoolboy. I'm not worried about downtime, though, so I think I'll just back up the DB and try the global substitution within the .sql file, and see if that works. As long as I keep a copy of the DB, I don't see that I can do too much harm.

    If it doesn't work, I guess I'll manually rename all the tables (tedious but not terribly so). I guess the one thing I'm wondering is, within the DB itself, are there *internal* references to table names that will get screwed up if I make these changes? This question is probably beyond the scope of this forum, but I figured I'd ask to see if anyone had any knowledge of the DB internals.

    Thanks.

 

 

Similar Threads

  1. v152 Plugin authors: Check for use of mysql* functions for compatibility with v1.5.2
    By lat9 in forum Contribution-Writing Guidelines
    Replies: 7
    Last Post: 27 May 2014, 07:10 AM
  2. Checking Contributions for PHP 5.3 Compatibility
    By swguy in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 29 Jun 2010, 04:29 PM
  3. Easy Populate Compatibility for 1.3.8a?
    By dmfelder in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 29 Jun 2008, 12:26 AM
  4. Problem during upgrade (after renaming tables to remove zen_ prefix)
    By rainthebat in forum Upgrading from 1.3.x to 1.3.9
    Replies: 5
    Last Post: 11 Dec 2007, 05:23 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