Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: How to Duplicate Zen Cart shop directory (same server) ?

    Once you have "cloned" all your files, and have what is a "duplicate" of all your code in a separate directory, you can use phpMyAdmin to make a copy of the database.

    When you have a duplicate of the database, all you need do is adjust your configure.php files in the cloned store to point to the new database.

    Before you "operate" your cloned store, you will probably need to run FIX CACHE KEY.

    This php file can be found in the Free Software Addons.

    After you have re-set the cache, your cloned store ought to work independently of your original store.

  2. #2
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    Default Re: How to Duplicate Zen Cart shop directory (same server) ?

    Quote Originally Posted by fairestcape View Post
    Before you "operate" your cloned store, you will probably need to run FIX CACHE KEY.
    Thank you very much for this tip, fairestcape. This is exactly the kind of Zen Cart specific information that I needed and I can't get from a general purpose MySQL newsgroup.

    I intend to eventually post in this forum a step-by-step HowTo that describes how to duplicate a Zen Cart store directory, including a duplicate (i.e. not linked) database. I hope that this will help others as much as other posters helped me so far.

    In the meanwhile here is a slight (but important) correction to the 'cp' shell command posted above:
    ~/public_html> cp -Rp shop testshop
    This correction will preserve the original store's permissions (important for security). It assume a Linux host.

    Also, here is a link to to FIX CACHE KEY add-on you mentioned.

    Lastly, here is another useful link that describes how to backup and restore the database, although it seems to me that this not really what you mean by "use phpMyAdmin to make a copy of the database". The reason is that it restores from backup to the exact same database, with the exact same name. Is my observation correct?

    If so, I think that what you were referring to by "use phpMyAdmin to make a copy of the database" is the "Copy database to:" in "Operations" tab in phpMyAdmin. Is this correct?

  3. #3
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    help question Re: How to Duplicate Zen Cart shop directory (same server) ?

    OK - I am so glad I am testing this before going live...

    I find DrByte's fix_cache_key.php incredibly helpful in duplicating the Zen Cart shop directory to testshop. However, I am having problems running it, perhaps because when I created the testshop database, using cPanel, the password in database user's password in:
    • admin/includes/configure.php
    • includes/configure.php

    No longer matches the password I specified for the newly created testshop database.

    How do I modify DB_SERVER_PASSWORD in both configure.php to match the password I specified when I created the testshop database?

  4. #4
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    red flag Re: How to Duplicate Zen Cart shop directory (same server) ?

    Quote Originally Posted by zcnb View Post
    How do I modify DB_SERVER_PASSWORD in both configure.php to match the password I specified when I created the testshop database?
    OMG - I can't believe it's so simple: the password specified in both configure.php files at the define('DB_SERVER_PASSWORD' line is stored in clear text...

    I just tried it and the fix_cache_key.php script worked!

    But now, I have a totally different question:

    Doesn't storing the database user password in clear text in the configure.php file constitute a potential security hole/risk?

  5. #5
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: How to Duplicate Zen Cart shop directory (same server) ?

    Quote Originally Posted by zcnb View Post

    Doesn't storing the database user password in clear text in the configure.php file constitute a potential security hole/risk?
    That's why you MUST chmod the files to at least 644 (or better to 444 which is what I do). If this is not done a warning appears in the browser when you visit the site.

    (Personal boast: My record for cloning a zenshop is just 11 minutes!)

  6. #6
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    Default Re: How to Duplicate Zen Cart shop directory (same server) ?

    Quote Originally Posted by fairestcape View Post
    That's why you MUST chmod the files to at least 644 (or better to 444 which is what I do). If this is not done a warning appears in the browser when you visit the site.
    Thank you for quickly addressing my concern. Indeed, I always make sure those files have their permissions set to 444.

    Still, 444 (as opposed to 440) means they are world-readable. Is this OK, in terms of security?

    Quote Originally Posted by fairestcape View Post
    (Personal boast: My record for cloning a zenshop is just 11 minutes!)
    I envy you. When I first started this project, I knew nothing about web technology (and much less about PHP/MySQL ...). I hope that by the time I am done, I will be able clone a zenshop in 111 minutes.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: How to Duplicate Zen Cart shop directory (same server) ?

    The FAQ on copying data to/from an offline testing server, usually a PC, covers the same process, but instructs to use FTP to copy the files, since that's what most people have available to them. Most don't have SSH access let alone the knowledge to use command-line instructions on a Linux server.

    Basically the process is this:

    1. Clone the files. Since you're working on the same server and same hosting account, AND you have shell access to your server, using your command-line "cp" approach is fine.
    2. Edit the cloned configure.php files to contain the correct database details for your testing database.
    3. Use phpMyAdmin to export your live database using the FAQ instructions.
    4. Use phpMyAdmin to restore your database backup into the database used for your testing site.

    5. Since you're running on the same server and hosting account, it's unlikely that you'll need to use fix_cache_key.php on your site.
    .

    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.

 

 

Similar Threads

  1. Replies: 41
    Last Post: 30 Jul 2013, 05:43 PM
  2. On Shared Server and cannot see directory where zen cart is installed
    By thss.consultant in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 21 Feb 2010, 01:14 AM
  3. Second Zen Cart on same server for wholesale site
    By Martin Smith in forum General Questions
    Replies: 10
    Last Post: 15 Jan 2010, 10:59 AM
  4. How Do I Duplicate My Zen Cart Store To A New Server?
    By beefclothing in forum General Questions
    Replies: 1
    Last Post: 21 Jun 2007, 04:16 PM

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