Shared Database for Multiple Installs

Open to all! Ask other shopowners for help.
Post Reply
madruga
Member
Posts: 38
Joined: Thu Mar 16, 2023 12:43 pm
Phoenix Version:
Has thanked: 22 times
Been thanked: 2 times

Shared Database for Multiple Installs

Post by madruga »

Hello, I want to ask if it is possible to have multiple installations of Phoenix sharing one database. I want a scenario where I can promote different brand names of my business for different customers. Is this possible? Thanks


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Shared Database for Multiple Installs

Post by Kofod95 »

I'm not sure, so hopefully others will chime in.

To share the db, the two configure files (includes/configure.php and admin/includes/configure.php) should have the same values in the db-section at the bottom.

The biggest obstacle I can think of, is the configuration table. You'd probably want that to be unique between the sites. However, I think that some of it could be taken care of by overriding this file https://github.com/CE-PhoenixCart/Phoen ... ration.php (drop a copy into includes/system/override - maybe the path has to be more specific). If you have several configuration tables, you could have them named configuration_shop_a, configuration_shop_b etc.
Then you'd need to figure out where the tables are updated, to make a similar override/edit there.

I haven't tried any of this, so please be careful!

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Shared Database for Multiple Installs

Post by Kofod95 »

One place that would need a work-around to configure modules separately is here: https://github.com/CE-PhoenixCart/Phoen ... odules.php

Another one here: https://github.com/CE-PhoenixCart/Phoen ... ration.php
That, and the action-files (admin/includes/actions/configuration)

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
madruga
Member
Posts: 38
Joined: Thu Mar 16, 2023 12:43 pm
Phoenix Version:
Has thanked: 22 times
Been thanked: 2 times

Re: Shared Database for Multiple Installs

Post by madruga »

Thank you @Kofod95 for this informative input. It does seem like this could get very complicated, so I'll have a think if I should explore this or keep running separate stores. It'll have been very nice to implement your suggestion but I don't want to break my stores :)
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Shared Database for Multiple Installs

Post by Kofod95 »

You could always try it out on your PC using Xampp or similar - but I'm glad that you are cautious! :)

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Shared Database for Multiple Installs

Post by burt »

I think it would be an interesting thing to try, equally I think it would be a mistake as order id's will be all mixed up, products would need to know where to show in what shop etc.

I think, someone with v.good coding knowledge of Phoenix, is working on some type of Phoenix based (I think) "Mall", which may be what you need. I don't want to tag that person because they'll likely be inundated with messages and emails. Maybe that person will see this post.

Otherwise;

Suggestion #1
Some sort of customer group addon ?

Suggestion #2
Multiple different shops (good possibilities for cross linking)
I am not here to build for you.
I am here to build with you. Let's help each other.
beerbee
Member
Posts: 48
Joined: Mon Oct 26, 2020 4:56 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 5 times

Re: Shared Database for Multiple Installs

Post by beerbee »

Hi,
this could be done with table prefixing for individual tables or groups of them, e. g. common products but individual categories, common orders but individual customers...

It was easy once when there was table definitions.

Kind regards
Christoph


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply