Most often, you have two types of environments:
- Local: Your store is installed locally, on your computer, and is accessible only by you.
- Production: Your store is hosted online and is accessible by your customers.
A pre-production environment, on the other hand, is an intermediate stage between the store you have set up locally and the store you have online.
Indeed, this pre-production environment is an online hosted store, but accessible only by you or by individuals within your company. It is generally a copy of your actual store.
This allows you to test your modifications, settings, modules, and themes under real conditions (on the same technical environment as the production version) without affecting the operation of your actual store.
Why should I have one?
Working directly on the production environment of the store is very risky, as any modification may potentially render the site unusable. In order to avoid these risks, we always recommend having a pre-production environment, as it allows you to test your modifications in an environment that is identical to the actual store, and if this environment is compromised, your business operations are not affected.
If you require our intervention to resolve an issue, and we need to access your back-office, we advise you to provide us with access to a pre-production environment, precisely to avoid potential risks.
How to create a pre-production environment?
To create a pre-production environment, numerous solutions are available. We advise you to consult a professional developer, a web agency, or the technical support of PrestaShop.
Caution: Only undertake this yourself if you possess a solid understanding of technical environments, FTP, and database management. Indeed, a false manipulation could render your production store inaccessible.
You can, if you are comfortable with FTP (File Transfer Protocol) and know how to use PHPMyAdmin, create your own pre-production environment.
Here are the steps to follow to achieve this:
- Log in via FTP to the hosting where your store is stored (either directly through the tool provided on your hosting provider's administration interface, or via an FTP software such as FileZilla).
- Download all the files that make up your store.
- Create, from your hosting provider's administration interface, an empty folder at the root of your hosting (outside the folder that contains the files of your store in production).
- Still from your hosting provider's administration interface, create a subdomain (e.g., preprod.maboutique.com) and associate it with the folder you just created.
- Paste the files you downloaded in step 2 into this folder.
- Delete the contents of the var/cache folder.
- Delete the .htaccess file located at the root.
- Log in to PHPMyAdmin from your hosting provider's administration interface and export the database associated with the production store.
- Create a new database, also from PHPMyAdmin, and then import the export file you have just downloaded into it.
- In this database, modify the following values:
- In the table ‘XX_shop_url’, modify the fields ‘domain’ and ‘domain_ssl’ by inserting the address of the subdomain created for this purpose.
- In the table ‘XX_configuration’, for entries where ‘name’ equals ‘XX_SHOP_DOMAIN’ and ‘XX_SHOP_DOMAIN_SSL’: insert the address of the subdomain in the ‘value’ field.
- Return via FTP to the folder containing the files of your pre-production store and edit the file app/config/parameters.php: specify the pre-production database information for ‘database_host’, ‘database_port’, ‘database_name’, ‘database_user’, and ‘database_password’.
You can now access your pre-production store from the created subdomain.