Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Location
    Aransas Pass, TX
    Posts
    101
    Plugin Contributions
    1

    Default Syncing local and remote stores

    Didn't really know where to put this. but here goes.

    I modify my site locally then upload to the live server when I am finished debugging.

    The problem is, sometimes i change gobs of files (especially when adding new 360view pages) and trying to find and upload each changed or new file is generally a daunting task.

    My solution was just to upload the entire 'includes' folder. Well, that works well, but I usually copy over the 'configure.php' file. Whoops! Even worse, I sometimes forget and have a non-working site for a bit.

    Solution! Yay!

    Rename my local file "configure_local.php", the remote file "configure_remote.php" and have both copies on both sites. Then build a new 'configure.php'.

    Code:
    <?php
     // sync configure.php with store location
      if ($_SERVER['SERVER_NAME'] == "store.local")
      {require ("configure_local.php");}
      else
      {require ("configure_remote.php");}
    ?>

  2. #2
    Join Date
    Jul 2012
    Posts
    13,841
    Plugin Contributions
    16

    Default Re: Syncing local and remote stores

    Better yet, provided you can perhaps incorporate it into your file comparison tool is to use the locals directory on your... well local site. When you upload, provided the locals directory is excluded, then there is no over write. Also, by keeping the file read only on your live site, it should not be overwritten generally speaking.

    Besides that if you use a comparison tool such as beyond compare (I believe there is an open source similar) then you can compare local to remote showing just the files that have differences and upload just those...

    Just another idea...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,768
    Plugin Contributions
    23

    Default Re: Syncing local and remote stores

    Beyond compare only has ftp abilities in the paid version, though it is a well spend $100. But if you need a simple compare tool I can recommend Total Commander. It is an Norton Commander (for those who still know) style file manager

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    1,398
    Plugin Contributions
    2

    Default Re: Syncing local and remote stores

    Quote Originally Posted by IATIA View Post
    Didn't really know where to put this. but here goes.

    I modify my site locally then upload to the live server when I am finished debugging.

    The problem is, sometimes i change gobs of files (especially when adding new 360view pages) and trying to find and upload each changed or new file is generally a daunting task.

    My solution was just to upload the entire 'includes' folder. Well, that works well, but I usually copy over the 'configure.php' file. Whoops! Even worse, I sometimes forget and have a non-working site for a bit.

    Solution! Yay!

    Rename my local file "configure_local.php", the remote file "configure_remote.php" and have both copies on both sites. Then build a new 'configure.php'.

    Code:
    <?php
     // sync configure.php with store location
      if ($_SERVER['SERVER_NAME'] == "store.local")
      {require ("configure_local.php");}
      else
      {require ("configure_remote.php");}
    ?>
    good for you with your new code! i like your resourcefulness!

    now, back to your main issue which is modifying code on your local machine and then bringing it up to your live server. what you need is source code version control. the time spent learning a tool to do version control is very well spent! you will then have a history of your changes in case something breaks on your live site. for anyone getting into coding and making changes, it is far better than manually keeping track of your changes using any of the compare tools out there.

    i recommend using git and then either bitbucket or github (but pick a tool you want to get comfortable with.)

    can be a bit daunting at first, but well worth the time.

    you can add you configure.php to a .gitignore file so that changes on one do not affect the other.

    best.
    no good deed goes unpunished. help out with the green....

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,466
    Plugin Contributions
    68

    Default Re: Syncing local and remote stores

    Regarding the configure.php override, Zen Cart has a built-in way to handle that.

    You'll create the directory /includes/local and copy your local configure.php to that directory. Ditto for /admin/includes, which already has a /local sub-directory; copy your local version of the admin's configure.php here.

    You can leave your "live"/hosted versions of the configure.php files in their normal spot. Zen Cart's start-up looks first for the presence of {/admin}/includes/local/configure.php, loading that if present. The constants are then defined by the local setup, overriding those present in your live version since the definitions pre-exist at that time.

  6. #6
    Join Date
    Nov 2009
    Location
    Aransas Pass, TX
    Posts
    101
    Plugin Contributions
    1

    Default Re: Syncing local and remote stores

    Quote Originally Posted by carlwhat View Post
    ... for anyone getting into coding and making changes, it is far better than manually keeping track of your changes using any of the compare tools out there.

    i recommend using git and then either bitbucket or github (but pick a tool you want to get comfortable with.)

    can be a bit daunting at first, but well worth the time. ...
    I think this is a great idea in the long run. Right now, I just tag and comment the files.

    Thanks to everyone for their input!

 

 

Similar Threads

  1. Which comes first - local or remote?
    By pharry in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 21 Jun 2009, 03:44 PM
  2. Replies: 4
    Last Post: 30 Oct 2008, 11:34 AM
  3. moved from local to remote problem
    By lieven23 in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 13 Sep 2008, 05:14 AM
  4. Local version of remote site
    By BlacksmithRon in forum General Questions
    Replies: 4
    Last Post: 15 May 2008, 01:38 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