Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2008
    Posts
    8
    Plugin Contributions
    0

    Default Move site but not database...

    Hello, I've just taken over maintaining the site of a company that's using ZenCart. One thing they're wanting me to do is move the zencart section of the site to a different server on the network but leave the database where it is.

    I updated the configure.php to go with the new site and when I change the DB_SERVER from "localhost" to the name of the old server it tells me it can't connect to the database. Is there anything I'm missing here?

    (windows servers using mysql and php, btw)

  2. #2
    Join Date
    Jul 2005
    Posts
    537
    Plugin Contributions
    0

    Default Re: Move site but not database...

    First, the DB_SERVER needs to point to the name of the server where the database resides. That name needs to be understandable by the webserver. It needs to be a name recognized by DNS. Using a "windows" name is pointless here because webservers don't understand windows computer names.

    Second, if you're using a DNS name, then that name needs to properly resolve to the correct IP address. If you can't "ping" that address from the other server, then of course the site won't connect to the database over there either.

    Third, the server where the database resides needs to be sure that its firewall is open to allow database access from the other server. But of course you don't want it open to the entire world or you risk your data being exposed to hackers. The MySQL website probably goes into much detail about properly securing the database so that logins can happen from other servers. Port 3306 is the usual port for MySQL traffic.

    Fourth, and this goes with the last point too, the username you're logging in with needs to have a user record linked to the name of the server you're connecting from, and of course all the same permissions as the username you used when logging in from localhost. Again, the MySQL website has lots of information on setting up additional users and granting permissions.

  3. #3
    Join Date
    Nov 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Move site but not database...

    awesome but the server are sitting right next to each other on the same subnet. Would I still need the firewall setup and stuff?
    All we're trying to do is split it up so the database isn't on the same server as the cart.

  4. #4
    Join Date
    Nov 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Move site but not database...

    ok, I've made sure the name was pingable and could communicate between two servers as was said before and still no luck.
    They're both behind the same firewall, we're just separating the website from the databases for performance reasons (at least that's what the network guy is saying.)

    Here's the config file as it currently stands. Maybe someone can see why its not connecting to the database. (note..identifying details have been removed to preserve my job.) To Reiterate: Only the code for the store is moving, the database is staying in the same place it was set up.

    Code:
    <?php
    /**
     * @package Configuration Settings circa 1.3.8
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */
    
    
    /*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
    /***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/
    
    // Define the webserver and path parameters
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
      define('HTTP_SERVER', 'http://www.site.net/store');
      define('HTTPS_SERVER', 'https://www.site.net/store');
    
      // Use secure webserver for checkout procedure?
      define('ENABLE_SSL', 'true');
    
    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      define('DIR_WS_CATALOG', '/');
      define('DIR_WS_HTTPS_CATALOG', '/');
    
      define('DIR_WS_IMAGES', 'images/');
      define('DIR_WS_INCLUDES', 'includes/');
      define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
      define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
      define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
      define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
      define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
      define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
    
      define('DIR_WS_PHPBB', '/');
    
    // * DIR_FS_* = Filesystem directories (local/physical)
      //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
      define('DIR_FS_CATALOG', 'C:/inetpub/wwwroot/SITE/store/');
    
      define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
      define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
      define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
      define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
      define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
    
    // define our database connection
      define('DB_TYPE', 'mysql');
      define('DB_PREFIX', '');
      define('DB_SERVER', 'APOGE001-VM01');
      define('DB_SERVER_USERNAME', 'dbuser');
      define('DB_SERVER_PASSWORD', 'dbpassword');
      define('DB_DATABASE', 'SITEStore');
      define('USE_PCONNECT', 'false');
      define('STORE_SESSIONS', 'db');
      // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage
    
      // The next 2 "defines" are for SQL cache support.
      // For SQL_CACHE_METHOD, you can select from:  none, database, or file
      // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
      // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
      // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
      define('SQL_CACHE_METHOD', 'file'); 
      define('DIR_FS_SQL_CACHE', 'C:/inetpub/wwwroot/SITE/store/cache');
    
    // EOF

  5. #5
    Join Date
    Nov 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Move site but not database...

    My bosses are really leaning on me now about this one. Anyone please?

  6. #6
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Move site but not database...

    1 is this the CORRECT host name for the mysql server APOGE001-VM01

    2 have you verified that port3306 is open to allow remote traffic? yes you still need to do this, same subnet or not,
    they are 2 seperate machines with seperate ruleset
    Zen cart PCI compliant Hosting

  7. #7
    Join Date
    Nov 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Move site but not database...

    Quote Originally Posted by Merlinpa1969 View Post
    1 is this the CORRECT host name for the mysql server APOGE001-VM01

    2 have you verified that port3306 is open to allow remote traffic? yes you still need to do this, same subnet or not,
    they are 2 seperate machines with seperate ruleset

    I'm guessing that's the right name because that's what it says on the mysql administrator under network name. Is there somewhere else I should be looking for that?

    as far as I know that port is open. There's no firewall between the two servers. Again, where should I look (windows 2008 server, btw and the windows firewall isn't enabled)

 

 

Similar Threads

  1. Replies: 9
    Last Post: 31 May 2015, 01:03 PM
  2. Products showing in Database but not on the site
    By g3steve in forum General Questions
    Replies: 8
    Last Post: 25 May 2011, 10:30 AM
  3. Replies: 4
    Last Post: 15 Oct 2010, 07:18 AM
  4. is it possible to move the customer database to another site?
    By ben harry in forum Managing Customers and Orders
    Replies: 3
    Last Post: 12 Jun 2009, 09:58 AM
  5. How do I move price on index but not product_info page?
    By shinyadornments in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Jan 2008, 03:37 AM

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