Jump to content

Different domains - one database


Recommended Posts

First you need to find out if the server with the main database allows outside connections.

If it does, then you need to enter the server settings in /config/settings.inc.php (server address, username, password and DB name)

EDIT:
It can really slow down the site though, depending on how far the servers are.

Link to comment
Share on other sites

Thanks for your response. The database would be on the same server. Do I change anything in the back office in ADMIN?
I am having problems with employee's password. Is that normal? I used the same password for both sites but the password to get to the admin now doesn't work. What about SSL...would it work?

Link to comment
Share on other sites

What about SSL…would it work?


If you want SSL (a non Self-signed SSL certificates) connection on your both store, you need one public address IP for each store.

If your stores adresses are like this : store1.mydomain.com and store2.mydomain.com you can buy one share SSL certification for the domain mydomain.com and you will don't need a second public address IP
Link to comment
Share on other sites

You need to make sure that the COOKEY_KEY (also found in the settings files) is the same as the main site.



I can see the cookie files (KEY and IV) in settings.inc.php but where are the other ones to pair them to? In the database somewhere?
Link to comment
Share on other sites

What about SSL…would it work?


If you want SSL (a non Self-signed SSL certificates) connection on your both store, you need one public address IP for each store.

If your stores adresses are like this : store1.mydomain.com and store2.mydomain.com you can buy one share SSL certification for the domain mydomain.com and you will don't need a second public address IP


Actually I have two different domains; mydomain1.com and mydomain2.com but currently only one SSL for mydomain1.com - I already have mydomain1.com up and running with its own SSL. I have set up mydomain2.com but I don't want a separate database for this domain. - same products, same customers, completely different theme (I know, I will have to get another IP address for mydomain2.com also) I just don't know if SSL is database dependent or not and whether it will cause an error when pulling data from mydomain1.com during checkout.
Link to comment
Share on other sites

they are just in the settings.inc.php

But you have two settings.inc.php, so the cookie_key from the main have to be copied into the settings.inc.php of the new store.


Thank you. That worked! Temporarily I blocked out password request in the tpl file for admin/login but was not a safe long term solution for sure!
Link to comment
Share on other sites

  • 6 months later...

I could not make it work:( I don't remember if it was only the https sites that didn't work or there were other issues also. Https sites did not work because as soon as https was called for domain2 from domain1 database it gave an error even though I had the SSL for both. If someone has overcome this problem please post your success here!!

Link to comment
Share on other sites

Can get a bit tricky indeed. I do not have to worrie about SSL, because sites will be used as a catalog only, no online sales (yet) :)
The tricky part imho is the admin section, since both sites use same db loginfeatures and admin functionallity. I'll have a go later on this day.
First i'll copy site A -> B via FTP so i have exact copy site structure like modules etc. If both sites look and behave identical, i'll work on css.
I'll keep you updated.

Link to comment
Share on other sites

  • 1 year later...

Wondering if you got it to work? I'm trying the same thing now, 2 domains, 1 database. I copied all the files from domain1 to domain2, but when I log in to the BO all the changes I make are affecting both websites, not just one. I want a shared database for stock keeping purposes, but not sure if it can be done.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...