Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Add database prefix...

    I know that when you setup Zen Cart you can choose a 'database prefix'. This would be 'zencart_' by default.

    However, when I first installed Zen Cart I did not opt for this prefix. Now I want/need it!

    How hard would it be to add this prefix?

    So far I have planned to do the following:

    1 - add prefix to all tables within database via phpmyadmin
    2 - use dreamweaver to do a 'find and replace', which will allow me to add the prefix to all relevant bits of code in my php files.

    Anything else I should consider?

    BTW - I have a heavily modified store.

    Thanks in advance.

    Alex

  2. #2
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: Add database prefix...

    <<However, when I first installed Zen Cart I did not opt for this prefix. Now I want/need it!>>

    Well, what is the need?

    I would recommend doing the new install rather than doing such things which might creep some errors!

  3. #3
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Add database prefix...

    Quote Originally Posted by superprg
    <<However, when I first installed Zen Cart I did not opt for this prefix. Now I want/need it!>>

    Well, what is the need?

    I would recommend doing the new install rather than doing such things which might creep some errors!
    I was planning on installing other database software within one database (eg - phpbb, more zen cart stores, ect...).

  4. #4
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Add database prefix...

    Just found this line in my configure.php

    define('DB_PREFIX', '');

    I'm guessing that I need to add the prefix there and then rename each table within my database.

    After that it should be a case of modifying any customer code to reflect the database changes.

    :)

    I'll post my results later on today.

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

    Default Re: Add database prefix...

    You can add the prefixes in automated fashion using zc_install.

    1. Make your two configure.php files read-write.
    2. Upload the zc_install folder to your server (you had deleted it after installation).
    3. On the System Inspection page, choose Database Upgrade
    4. At the bottom of the page, you have the option to specify new prefix details.
    5. Set your configure.php files to read-only again
    6. Look at your database in phpMyAdmin to ensure that all tables were renamed ... if you had created custom tables, they may or may not have been converted... you can address any stragglers manually.
    .

    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.

  6. #6
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Add database prefix...

    Quote Originally Posted by DrByte
    You can add the prefixes in automated fashion using zc_install.

    1. Make your two configure.php files read-write.
    2. Upload the zc_install folder to your server (you had deleted it after installation).
    3. On the System Inspection page, choose Database Upgrade
    4. At the bottom of the page, you have the option to specify new prefix details.
    5. Set your configure.php files to read-only again
    6. Look at your database in phpMyAdmin to ensure that all tables were renamed ... if you had created custom tables, they may or may not have been converted... you can address any stragglers manually.
    Thanks for the info DrByte! I didn't fancy running the ZenCart installer again (just incase it dumped all of my database). So instead I edited the config files and then manually added 'zen_' as a prefix to all db tables via phpmyadmin. This worked a treat and all the contributions in my heavily customised shop still work!

    Thanks for the help! :)

 

 

Similar Threads

  1. add prefix to database
    By balihr in forum General Questions
    Replies: 8
    Last Post: 10 Nov 2009, 12:37 AM
  2. Add a prefix to database tables
    By hyperlite635 in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 13 Oct 2007, 10:32 PM
  3. Database Prefix
    By Erica in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 22 Jul 2007, 09:43 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