Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Feb 2012
    Posts
    68
    Plugin Contributions
    0

    Default Connect to storefront and database on a different server.

    PHP 5.6.40 PHPMyAdmin version: 7.3.27 Fast and Easy Checkout

    Last week my zen-cart was copied to another domain because I couldn't stop google from throwing a phishing warning on my Zen-cart storefront order page.

    Both zen-carts, on 2 different domains have their own storefront, admin mgmt and database. So...I have Zen-cart fully set up on both domains.

    Purchasers are still finding the old order form storefront and ordering from it.

    I use Zen-cart for students to order courses, and the moodle course management system that students use to access online courses, verifies the order on the zen-cart database before it allows a student to log-in to his/her course. I switched the moodle check to find the order in the new zen-cart database, so the student can't get into the course if he/she orders on the old order form, connected to the old database. Also the student's information enters into the old admin site.

    Is it possible to keep the old order form storefront operational but have it send the student order information to a Zen-cart database and admin site on another domain so that everything would gather in one spot and the student can be verified by the moodle?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Connect to storefront and database on a different server.

    If your database is still on the same physical server there should be no lag involved by specifying the "new" database in the "old" site's configure.php files.
    .

    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.

  3. #3
    Join Date
    Feb 2012
    Posts
    68
    Plugin Contributions
    0

    Default Re: Connect to storefront and database on a different server.

    One database is on abcrealestateschools.com and 1 database is on abcrealestateschool.com. I want both storefronts to send information to the admin and database on abcrealestateschool.com. So I need to tell the storefront on abcrealestateschools.com to send the orders to the admin and database on abcrealestateschool.com and not the database and admin on its server on abcrealestateschools.com.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Connect to storefront and database on a different server.

    Are they actually physically separate "servers"? Or just different domains on the "same server" hardware?

    Apart from security, the main concern is speed of database queries:
    Fastest: both databases on the same physical server
    Next fastest: both databases on servers in the same network, with proper firewall rules allowing both servers to talk to each other
    Slowest: servers on different networks

    Your hosting company should be able to set up the database firewall rules on the new server to allow only the IP address of the old server to "use" the new server's database.
    Then in your old site's configure.php files you'd put all the DB_XXXXXX credentials copied from the new server's configure.php. Admin and non-admin.
    .

    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.

  5. #5
    Join Date
    Feb 2012
    Posts
    68
    Plugin Contributions
    0

    Default Re: Connect to storefront and database on a different server.

    They are both hosted by siteground, but the database locations are different. So are there multiple config.php files to change?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Connect to storefront and database on a different server.

    Quote Originally Posted by abcschooldr View Post
    So are there multiple config.php files to change?
    Every Zen Cart store (at least until until v1.5.7 which is the most recent as of today) has two configure.php files: /includes/configure.php and /admin/includes/configure.php ... and both need the database details set in them.
    .

    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.

  7. #7
    Join Date
    Feb 2012
    Posts
    68
    Plugin Contributions
    0

    Default Re: Connect to storefront and database on a different server.

    I am in /includes/configure.php. It looks like it lists 2 server url's and define('DIR_FS_CATALOG'. So If I change all 3, it will use courses/products from the admin on the new server, keeping it up to date?

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Connect to storefront and database on a different server.

    No, this section needs to be copied from the new server to the old:
    Code:
    /**
     * The following settings define your database connection.
     * These must be the SAME as you're using in your admin copy of configure.php
     */
    define('DB_TYPE', 'mysql'); // always 'mysql'
    define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET', 'utf8mb4'); // 'utf8mb4' or older 'utf8' / 'latin1' are most common
    define('DB_SERVER', 'localhost');  // IP address of your db server
    define('DB_SERVER_USERNAME', 'something');
    define('DB_SERVER_PASSWORD', 'something');
    define('DB_DATABASE', 'somedbname');
    And if the new server uses "localhost" for the DB_SERVER value, then your hosting company will need to give you the new server's IP address instead AND make sure the new server's firewall allows the old server's IP to access the database, and probably allow that IP address in the user credentials inside the database. But their tech staff (should be expert enough to) understand all that (cuz they do it everyday) so just ask them to take care of it.
    .

    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.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Connect to storefront and database on a different server.

    I suppose yes you could also edit the HTTP_SERVER and HTTPS_SERVER to use the new domain name, but that will only work after they first click something on your old domain. So, yes you can change those two to match the new server, but also have your hosting company set a redirect from the old domain to the new. (again, that's something they do everyday)
    .

    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.

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Re: Connect to storefront and database on a different server.

    Quote Originally Posted by abcschooldr View Post

    Last week my zen-cart was copied to another domain because I couldn't stop google from throwing a phishing warning on my Zen-cart storefront order page.
    I really think you should spend time figuring this out, because it sounds like your site has been hacked and you haven't actually fixed the issue. (This means that sooner or later Google will be throwing phishing warnings on the new site.)
    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Can't connect to database after server move
    By hp9 in forum General Questions
    Replies: 4
    Last Post: 1 May 2017, 05:52 AM
  2. v154 crashed database, missing products on storefront and admin
    By buildingblocks in forum General Questions
    Replies: 6
    Last Post: 10 May 2016, 11:55 AM
  3. v138a Connect to database and variables in a javascript
    By carol in forum General Questions
    Replies: 9
    Last Post: 12 Jun 2013, 10:50 AM
  4. how could we connect database in new server?
    By rainmist in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 8 Feb 2010, 02:09 PM
  5. Cannot connect to to storefront from browser
    By rubicontrek in forum Installing on a Mac Server
    Replies: 12
    Last Post: 16 Jun 2006, 08:12 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