Results 1 to 10 of 18

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Posts
    31
    Plugin Contributions
    0

    Default One database for two websites

    I have a live working Zencart site and would like to have a sandbox site that uses the same database. can that be done? If so, I would appreciate any guidelines on how to implement it. thanks

  2. #2
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: One database for two websites

    No, it can't be done. Any changes you make to the database in test (selecting a new template, adding categories/products, etc) will be reflected in the live store.

    If you are restricted to one database, you should be able to give your test site's tables a different prefix, which should solve the problem I mentioned above.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

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

    Default Re: One database for two websites

    Mary Ellen is correct...

    As a huge number of shop parameters are controlled in the database, having more than one site share a database (while possible) will mean that configurations applied to any one site, will also be applied to all the others using the same database.

    So, your "sandbox" changes will also appear in your real store...

    By using a different TABLE PREFIX, you can "house" data for a different application in any database.

    So, for example, your LIVE STORE may have the tables prefixed by ZEN_ (a common prefix) or may mot have a prefix at all.

    You could do a second install of ZC (in a sub folder of your main site) and in the process of installing, ensure that a PREFIX is given to the tables for that second install.

    Much better is to create a full CLONE of the site, and have its dbase competely separate. (if your host is generous enought to allow more that one dbase)
    20 years a Zencart User

  4. #4
    Join Date
    Jan 2008
    Posts
    31
    Plugin Contributions
    0

    Default Re: One database for two websites

    Thank you both for very clear answers :)

  5. #5
    Join Date
    Mar 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: One database for two websites

    :-)

    Sorry for bumping this old thread, but I'm considering the same thing.

    I want to share the product-information between two shops which carry the same items. MultiSite isn't an option, because I don't want to share the carts / customer info etc.

    The idea is to create two shops in a single database, using two different table-prefixes, zen1_ and zen2_ and create tables for both stores.

    After creating both stores, I'll drop the products tables from the zen2_ database, and make views to the zen1_ tables.

    Since views work like tables (with some restrictions) this might actually work :-)

    The plan looks almost too simple :) Anyone who tried this? Or anyone who sees any drawbacks?

  6. #6
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: One database for two websites

    The separate prefixes should work and keep the information separate, but you can't mix and match between them, so store1 will use zen1 and store2 will use zen2.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

 

 

Similar Threads

  1. Two Websites Sharing the Same MYSQL Database
    By limelites in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 25 Nov 2012, 05:26 PM
  2. Two Websites / One Database
    By irishshopper in forum Basic Configuration
    Replies: 4
    Last Post: 22 Nov 2010, 10:38 AM
  3. Two websites, one items database possible?
    By fritzy in forum General Questions
    Replies: 2
    Last Post: 25 Nov 2008, 11:26 PM
  4. Two websites from the same database.
    By bigjoed in forum General Questions
    Replies: 5
    Last Post: 14 Sep 2007, 03:04 PM
  5. One PayPal account - two websites?
    By Peekay in forum Addon Payment Modules
    Replies: 1
    Last Post: 20 Jun 2006, 12:58 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