acastrolorenzo Posted November 3, 2011 Share Posted November 3, 2011 Hi there, I wan't to clone my prestashop site, I have one installation in one folder of my server then I want to create another database and link the new copied files to it. My inicial idea was: copy the folder of prestashop then dump it to another folder, and then, create a new database to use the option "preferences - database - change database". I have made the copy of the files, but when enter to the copied site it redirects me to old one. My question is, how would you clone a prestashop site?. Thanks in advance Link to comment Share on other sites More sharing options...
Dave L Posted November 3, 2011 Share Posted November 3, 2011 You will need to change the database name, username and password in the config/settings.inc.php to those of the new 'duplicate' database. 1 Link to comment Share on other sites More sharing options...
acastrolorenzo Posted November 4, 2011 Author Share Posted November 4, 2011 Mmmm interesting, and how is the best way to duplicate the database?. Then, is this the formula?: 1. Copy the files 2. Duplicate DB 3. Create user and privileges 4. Customize the settings.inc.php Thanks again Link to comment Share on other sites More sharing options...
Dave L Posted November 4, 2011 Share Posted November 4, 2011 Log in to your control panel, navigate to your database section and to your phpMyAdmin and export a copy of your existing database. Then create a new database in the same way you did for the original prestashop installation. Give it a different db name, username and password to the original one. Go back to phpMyAdin to manage the new database and import the exported file you made from the old database. The edit the settings.inc.php file of your duplicated site and change the database setting to that of your new database. You will be able access your FO and BO using the same credentials at the new location. Link to comment Share on other sites More sharing options...
acastrolorenzo Posted November 4, 2011 Author Share Posted November 4, 2011 What I've tried: 1. Copy old files to new folder 2. Export old db on phpmyadmin 3. Create new empty database with new user 4. Import the old db to the new empty one 5. Configurate the settings.inc.php, specifically: define('_DB_NAME_' define('_DB_USER_' define('_DB_PASSWD_' define('__PS_BASE_URI__' Rest I think is the same But still redirect to the old one, then I try another solution, the same as after but replacing all the calls to the old directory on the database to the new one, and neither works... Any idea?, Thanks in advance! Link to comment Share on other sites More sharing options...
Dave L Posted November 4, 2011 Share Posted November 4, 2011 Well, I'm pretty sure you have done all the steps correctly. However, there should be no need to replace any 'calls' or anything. Did you have a .htaccess file in the duplication. If so try deleting this. You can generate a new one after you have the installation running again. Link to comment Share on other sites More sharing options...
acastrolorenzo Posted November 4, 2011 Author Share Posted November 4, 2011 I didn't find out .htaccess on the copy. So, I shouldn't modify the database before importing?, there are many calls to the old folder there. Thanks again Link to comment Share on other sites More sharing options...
Dave L Posted November 4, 2011 Share Posted November 4, 2011 Well I have never done this before and never had a problem. This was pretty much the way to upgrade prestashop, creating a duplicate site in a sub-folder to carry out the upgrade while keeping your existing site live, and then moving from a sub-folder to root once completed. Can you not access your FO or BO at all. How about deleting your cookies in your browser, or try a different browser. Link to comment Share on other sites More sharing options...
acastrolorenzo Posted November 4, 2011 Author Share Posted November 4, 2011 Mmm no, the problem stills, I've tried on different computers and so. I'll try again in half hour and post results. Thanks Dave! Link to comment Share on other sites More sharing options...
acastrolorenzo Posted November 4, 2011 Author Share Posted November 4, 2011 Ok here's the new try: 1. Copy old files to new folder 2. Export old db on phpmyadmin 3. Create new empty database with new user 4. Import the old db to the new empty one 5. Configurate the settings.inc.php, specifically: <?php define('_DB_SERVER_', 'localhost'); define('_DB_TYPE_', 'MySQL'); define('_DB_NAME_', 'newdb'); define('_DB_USER_', 'newuser'); define('_DB_PASSWD_', '*********'); define('_DB_PREFIX_', 'ps_'); define('_MYSQL_ENGINE_', 'InnoDB'); define('__PS_BASE_URI__', '/newfolder/'); define('_PS_CACHING_SYSTEM_', 'MCached'); define('_PS_CACHE_ENABLED_', '0'); define('_MEDIA_SERVER_1_', ''); define('_MEDIA_SERVER_2_', ''); define('_MEDIA_SERVER_3_', ''); define('_THEME_NAME_', 'prestashop'); define('_COOKIE_KEY_', '***********************************'); define('_RIJNDAEL_KEY_', '***************************'); define('_COOKIE_IV_', '*************'); define('_RIJNDAEL_IV_', '************/***********=='); define('_PS_CREATION_DATE_', '2011-10-28'); define('_PS_VERSION_', '1.4.4.1'); ?> There's no .htaccess. I can enter to the BO, but when try to enter to the FO only appears blank (no 404 error, so it's something). What's wrong?, any idea?. Thanks, Antonio Castro Link to comment Share on other sites More sharing options...
acastrolorenzo Posted November 4, 2011 Author Share Posted November 4, 2011 Ohhh yeahhh!!! at last I've achieved it!! you have to do that and after change the permissions of the required folders (as standar installation). Thanks Dave!. Link to comment Share on other sites More sharing options...
Dave L Posted November 4, 2011 Share Posted November 4, 2011 It's good that you have finally got it sorted. Good luck. Link to comment Share on other sites More sharing options...
Recommended Posts