Forums / General Questions / Database located on different domain from cart files

Database located on different domain from cart files

Views: 585

Results 1 to 3 of 3
28 May 2011, 8:10 PM
#1
ronlee67 avatar

ronlee67

Totally Zenned

Join Date:
Sep 2006
Location:
Colorado Springs CO USA
Posts:
519
Plugin Contributions:
0

Database located on different domain from cart files

I have moved my Zencart files to a new server on a different domain, but will keep the MySql database on the old server.

Can someone tell me what to show for DB_SERVER in the catalog and admin configure.php files?

The old entry is define('DB_SERVER', 'localhost:/tmp/mysql5.sock');
The database is located on [myservername].macminicolo.net

I'm guessing the configure.php entry would be something like:```
define('DB_SERVER', '[myservername].macminicolo.net/temp/mysql5.sock');

Can anyone confirm this or provide the correct syntax?

www.aspenshopsonline.com - ZenCart 1.3.9h
www.wilkssupply.com - ZenCart 1.3.9h
www.un-du.net - ZenCart 1.3.8a

28 May 2011, 8:25 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Database located on different domain from cart files

Keep the colon (:) just like before. Just replace "localhost" with whatever the new servername is.

HOWEVER ... A VERY IMPORTANT NOTE: if your webserver and database-server are on different computers, and especially if they're in different physical locations, you run the risk of opening yourself up to security problems and SLOW performance.
Database lookups over the physical bus are fastest. Over ethernet to another computer in the same network/datacenter are slower. Over internet connections to another physical location are MUCH slower, and could be intercepted/hijacked/sniffed by hackers if numerous security precautions aren't taken.

Disclaimer: The changes you're talking about are advanced concepts and should only be attempted by those with strong knowledge of server security and networking skills.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 May 2011, 2:37 AM
#3
ronlee67 avatar

ronlee67

Totally Zenned

Join Date:
Sep 2006
Location:
Colorado Springs CO USA
Posts:
519
Plugin Contributions:
0

Re: Database located on different domain from cart files

Thanks DrByte. I appreciate your pointing out the caveats. In my case I would have had the worst scenario you pointed out so it's probably not a good idea.

We are moving our websites from a shared hosting service to our recently purchased MacMini server at a co-location site. We have moved one of the three sites so far. Unfortunately a recent PCI scan required more configuration changes that resulted in that domain being down the last few days and techs still stumped.

My idea was to restablish the ZC files back on the old host temporarily, point DNS there and give the techs some breathing room (and me back to sales) until the problems are resolved. Once the problem was fixed I would repoint the DNS back to the new server.

I do have the option to copy the MySQL5 database to the old host, and given your fine advice, I think that is the better option.

Ron

www.aspenshopsonline.com - ZenCart 1.3.9h
www.wilkssupply.com - ZenCart 1.3.9h
www.un-du.net - ZenCart 1.3.8a