Jump to content

How-to steps to duplicate prestashop 1.7 store to test


nickzampieri

Recommended Posts

Hello,

I have a production store in my domain that looks like this: example.com/store

I want to be able to create a duplicate of this store to be able to perform tests when new modules are released to ensure that it continues to work. For example, the test store would be example.com/test

I want to make sure that the database is also copied over and that the /test store is using the copy of the database to ensure that product and customer changes in /test are updating the right tables in the non-prod database.

Are there any really detailed instructions on how to do this with prestashop 1.7?

From what I have gathered, I can

  1. Copy the directory and files from example.com/store to example.com/test
  2. Export the MySQL db using phpmydamin, edit the exported files somehow so that when you import them back, they end up in a separate DB
  3. Edit some configuration files to reflect example.com/test instead of example.com/store (.htaccess file or something?)
  4. put test store in maintenance mode.
  5. rename all customers accounts with a "xxxtst" prefix so that people that may fall into the /test store cannot do much
  6. ensure that search engines do not crawl this test site and index it and start posting links to it from their search engine results
  7. Delete cached files/directories somewhere on newly copied directories/files
  8. update the cron jobs that may still be referring to example.com/store folders?
  9. run other BO scripts/indexing/images to "update" things in the example.com/test store(db and folders)

 

As you can see, its pretty generic. I have been searching around and though that I would be able to find something like this quite easily, and yet I have not found anything or have not searched the correct terms.

I have been burned way too many times with updating modules that end up breaking things. I also have been burned by the 1-Click upgrade tool. I would love to run it against my "duplicate" store before attempting it against my production store. Furthermore, at times, I need to allow module developers access to my store to be able to develop and test out some things that I don't want them to do against my production store.

 

I think documentation like this could be really useful for many developers out there and for store owners.

Thanks,

Nick

 

Link to comment
Share on other sites

  • nickzampieri changed the title to How-to steps to duplicate prestashop 1.7 store to test

To clone a PS 1.7. is the same procedure as to clone each other PS Version. Take a look into one of mine old tutorials: https://www.prestashop.com/forums/topic/313999-tutorial-how-to-clone-your-shop-for-upgrades/

The only difference is on  4- the settings file you will find in PS 1.7. in folder /app/config/parameters.php now instead of on older versions /config/settings.inc.php

Link to comment
Share on other sites

I'm not sure to understand your question. The steps you describe are correct.
I've also created two separated environments, one for dev/test and one for prod.
If you're working as a team, you could even have three environments: dev, test and prod.
I've created a dev environment locally, using an older PC with Ubuntu.
This speeds up things and give me access to all "backdoors" on the server.
And the combination Apache/MySQL, PHP is incredibly faster on Ubuntu than on Windows...


 

Link to comment
Share on other sites

  • 3 years later...
  • 3 months later...
On 11/25/2017 at 4:05 AM, nickzampieri said:

Hello,

I have a production store in my domain that looks like this: example.com/store

I want to be able to create a duplicate of this store to be able to perform tests when new modules are released to ensure that it continues to work. For example, the test store would be example.com/test

I want to make sure that the database is also copied over and that the /test store is using the copy of the database to ensure that product and customer changes in /test are updating the right tables in the non-prod database.

Are there any really detailed instructions on how to do this with prestashop 1.7?

From what I have gathered, I can

  1. Copy the directory and files from example.com/store to example.com/test
  2. Export the MySQL db using phpmydamin, edit the exported files somehow so that when you import them back, they end up in a separate DB
  3. Edit some configuration files to reflect example.com/test instead of example.com/store (.htaccess file or something?)
  4. put test store in maintenance mode.
  5. rename all customers accounts with a "xxxtst" prefix so that people that may fall into the /test store cannot do much
  6. ensure that search engines do not crawl this test site and index it and start posting links to it from their search engine results
  7. Delete cached files/directories somewhere on newly copied directories/files
  8. update the cron jobs that may still be referring to example.com/store folders?
  9. run other BO scripts/indexing/images to "update" things in the example.com/test store(db and folders)

 

As you can see, its pretty generic. I have been searching around and though that I would be able to find something like this quite easily, and yet I have not found anything or have not searched the correct terms.

I have been burned way too many times with updating modules that end up breaking things. I also have been burned by the 1-Click upgrade tool. I would love to run it against my "duplicate" store before attempting it against my production store. Furthermore, at times, I need to allow module developers access to my store to be able to develop and test out some things that I don't want them to do against my production store.

 

I think documentation like this could be really useful for many developers out there and for store owners.

Thanks,

Nick

 

did you find anything on this - how did you get on?. I have a badly preforming early 1.7 version that i want to upgrade to a VPS. My plan was to install a fresh latest 1.7 ps then import the old site data. Not sure if thsi will work? 

Link to comment
Share on other sites

On 12/1/2017 at 6:33 AM, Pierre_d said:

If you're working as a team, you could even have three environments: dev, test and prod.

I can add that having 3 development spaces (dev, test and prod) is even more useful if dev is a local site.
This way you will be able to version your site.

In my example I use the Atlassian suite (Bitbucket) to manage my versions and then, once my versions are pushed, I send the changes directly to my test site via Rundeck.

With this way of working you have the possibility to test everything on a local without any worries and to push your modifications on your test site in order not to have to rewrite them once again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...