Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Location
    UK
    Posts
    232
    Plugin Contributions
    0

    Default Shared database ?

    I have a question and i hope someone can help me with this.

    I was thinking of having two identical shops with a shared database.

    Only one shop will be running at a time whilst the other shop will be used to do updates on etc.

    The idea is that when shop A is running shop B can be as a backup or i can do the zencart updates on it and then move the URL redirection to shop B whilst shop A is being updated.
    This would mean that there is very little disruption.

    BUT, can this be done or should i stick to two identical shops with two identical databses?

    Thank you

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    10,828
    Plugin Contributions
    80

    Default Re: Shared database ?

    If two Zen Cart shops share a database, each shop needs to have a different DB_PREFIX so that, for instance, shop #1's admin table is different from shop#2's zen_admin table.

    Unless your web-host severely limits the number of databases you can have in your hosted account, I'd go with the "separate database" approach so that the configuration of the store(s) can be consistent.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    8,230
    Plugin Contributions
    112

    Default Re: Shared database ?

    ... but the model you are discussing is really not workable; the two databases will have overlapping order numbers as you switch back and forth, and customers who placed an order on A won't be able to see it when you switch to B. And if you shared a database that wouldn't work either; a 1.5.5 database will blank screen if 1.5.6 software is run on it, for example.

    Have one live site and one test site.
    Separate databases.
    Try out fixes, changes, etc. on test. When you're happy, apply them to live.

    https://docs.zen-cart.com/user/running/local_testing/
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    May 2008
    Location
    UK
    Posts
    232
    Plugin Contributions
    0

    Default Re: Shared database ?

    Quote Originally Posted by lat9 View Post
    If two Zen Cart shops share a database, each shop needs to have a different DB_PREFIX so that, for instance, shop #1's admin table is different from shop#2's zen_admin table.

    Unless your web-host severely limits the number of databases you can have in your hosted account, I'd go with the "separate database" approach so that the configuration of the store(s) can be consistent.
    Thank you for your reply.

    I think that to keep things simple i would be better off with each shop having its own Database.

    Thanks for your help

  5. #5
    Join Date
    May 2008
    Location
    UK
    Posts
    232
    Plugin Contributions
    0

    Default Re: Shared database ?

    Quote Originally Posted by swguy View Post
    ... but the model you are discussing is really not workable; the two databases will have overlapping order numbers as you switch back and forth, and customers who placed an order on A won't be able to see it when you switch to B. And if you shared a database that wouldn't work either; a 1.5.5 database will blank screen if 1.5.6 software is run on it, for example.

    Have one live site and one test site.
    Separate databases.
    Try out fixes, changes, etc. on test. When you're happy, apply them to live.

    https://docs.zen-cart.com/user/running/local_testing/


    Thank you for your help. I will just keep it simple and avoid a headache lol

    thanks

  6. #6
    Join Date
    Jul 2012
    Posts
    16,180
    Plugin Contributions
    17

    Default Re: Shared database ?

    To add for anyone taking up the earlier approach of using two different DB_PREFIX designations within a single database, one of the utilities provided in the Zen Cart plugins list is a database backup/restore utility. While a great option and very helpful, the backup and restore provides a complete backup (and subsequent restore) of *ALL* of the database. Great and not a problem per se, when "used" correctly, but if some care is not taken, then restoration of the database to support "site 2" testing, will also restore the database for "site 1" with whatever is in the backup file.

    As to though the "outage" during updates. Even with having one or two "live" sites and using whatever else as a backup, when actually updating the live site, this should really only take at most a couple of hours for the site to be in maintenance mode, though could be as short as a couple of minutes with a well coordinated process of placement and testing.

    Experimentation should be done on a backup site to prove how to do and how successful the "update" will be and what it will take. Let the live site(s) do their thing until the update is ready and preferably proven will be successful.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. 2 sites Shared database and images folder
    By Parafanaylya in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 16 Apr 2015, 10:24 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