Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Dec 2008
    Location
    Cape Town! South Africa
    Posts
    9
    Plugin Contributions
    0

    Default Can I change what database ZenCart is using?

    Hi

    Is it possible to change the database that ZenCart reads from? And if so, what do I need to do that?

    Alternatively, is there any way to copy everything from one sql database to another one that has nothing in it?

    Thanks in advance
    :-)

  2. #2
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,748
    Plugin Contributions
    0

    Default Re: Can you change what database ZenCart is using?

    Yes in the includes/configure.php and admin/includes/configure.php is a database section that looks like the following:
    Code:
    // define our database connection
    define('DB_TYPE', 'mysql');
    define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
    define('DB_SERVER', 'localhost');
    define('DB_SERVER_USERNAME', 'YOUR_DB_USERNAME');
    define('DB_SERVER_PASSWORD', 'YOUR_DB_PASSWORD');
    define('DB_DATABASE', 'YOUR_DB_NAME');
    You can adjust this to look at the correct database.

    You can use phpmyadmin, if your hosting control panel has access to it, to export the database and to import into the empty database.
    Mike
    GeekHost - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  3. #3
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    160
    Plugin Contributions
    0

    Default Re: Can you change what database ZenCart is using?

    hello! this might be a bit old.. but i didn't feel i need to create a new thread if I a question that relates to this change.

    What do I do with the existing database before I switch it?

    Right now it's using database A

    My zencart is Database b.

    Do I need to re-direct database A?

    Some notes:

    The author of Database A did not create a folder for the files. it's all in the root folder. Database A was made from scratch.

    THANK YOU!

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Can you change what database ZenCart is using?

    In principle you simply make the changes that barco57 describes. These don't affect the databases at all, just change the database that the site points too. But I suspect we don't have the whole story. Is your site live? If so, what are you going to do with any orders already recorded there? Has your new database been set up ready to accept the redirection?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    160
    Plugin Contributions
    0

    Default Re: Can you change what database ZenCart is using?

    my current site is live and it's just a showroom. it's configurations are completely different from zencart as it's written from scratch. it's very simple.

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Can you change what database ZenCart is using?

    So Zen Cart has nothing to do with your existing database. I'm confused. Are you asking how your would transfer information from your existing site's database into Zen Cart?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    160
    Plugin Contributions
    0

    Default Re: Can you change what database ZenCart is using?

    im sorry i wasn't very clear. Right now, is the live site. I don't want that anymore. I would like the url www.greatintl.com to redirect to my zencart. I know that I would have to change the server in my configure.php files to reflect that. However, I don't know what to do with my current one. I don't want to delete it or anything. I want it to still be there so I can switch it back if problems arise.

    My live site and zencart have their own separate info. I don't want anything carried over. Just a swtich so when www.greatintl.com is visited, they will see zencart vers.

    Does that make sense?

  8. #8
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Can you change what database ZenCart is using?

    Yes. Move all the files in your current site to a subdirectory (/old, for example) then move the Zencart folders and files to the root (top directory) and make the changes to the configure files noted above or here:

    https://www.zen-cart.com/tutorials/i...hp?article=122

  9. #9
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    160
    Plugin Contributions
    0

    Default Re: Can I change what database ZenCart is using?

    Hey Stevesh!

    Thanks for your reply! So I took a look at your post and at the link you provided and from my understanding in reading this that it seems fairly simple:

    Move the current website's files to a new folder
    (I would like to keep zencart in it's current folder. So the root will have these 2 folders: one is the /old and the other is the zencart one)
    Locate /includes/configure.php and /admin/includes/configure.php files and change settings to become writable.

    Then change these settings to reflect the new location and URL:

    # DIR_WS_CATALOG
    # DIR_WS_HTTPS_CATALOG
    # DIR_FS_CATALOG
    # DIR_FS_SQL_CACHE
    # DIR_WS_ADMIN (in admin)
    # DIR_WS_HTTPS_ADMIN (in admin)
    # DIR_FS_ADMIN (in admin)

    Then change it back to read-only

    Correct?

  10. #10
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    160
    Plugin Contributions
    0

    Default Re: Can I change what database ZenCart is using?

    So I've done more reading on this matter.. and from my understanding.... zencart files MUST be in the root folders, it cannot be placed in another folder?

    root/
    all zencart files

    NOT

    root/zencart/
    all zencart files

    Correct?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Are these sites using zencart? What template?
    By MikenIke in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Aug 2009, 10:34 AM
  2. Using Zencart with another database?
    By chrisj in forum General Questions
    Replies: 1
    Last Post: 9 Apr 2009, 05:14 PM
  3. Can zencart do what I want it to?
    By Sake in forum General Questions
    Replies: 2
    Last Post: 2 May 2007, 06:20 PM
  4. can Zencart do what i want??
    By Wilkesy in forum General Questions
    Replies: 2
    Last Post: 16 Oct 2006, 09:20 AM
  5. what database am I using?
    By zami in forum General Questions
    Replies: 0
    Last Post: 8 Sep 2006, 10:17 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