Developer's copy of the online store
Some of the modifications you make to your online store require changes to files and the database. Often, the work stretches over time because it requires analysis or multiple comparisons. A developer's copy of your store will protect you from errors you won't miss. Thanks to the copy you will avoid downtime in sales, and the comfort of your work on the developing store will increase.
A copy is a 1:1 duplicate of the files and database of your store. A copy of the store gives you control over changes before they reach your customers, and you can modify it without worrying about the functioning of the production store. A development store is usually placed in a subdomain of your store's domain, e.g. dev.yourjadomena.pl. Such a copy does not interfere with the production store and is invisible to web robots, yet easy to access for you and your colleagues.
PrestaShop copy in 10 steps
- Using SSH, pack your store files.
Using PhpMyAdmin , for example, make a copy of the database.
- Create a new database and upload the made copy to it.
- In the new database, find the ps_shop_url and ps_configuration tables and replace the values in PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
- Extract the files using SSH to a new folder on the server, which you will place outside the directory of your store.
- Clean the extracted files from the contents of the cache folder:
PrestaShop 1.6: /cache
PrestaShop 1.7: /var/cache.
- Enter the data for the new database in the file:
PrestaShop 1.6: config/settings.inc.php
- In the server panel, create a subdomain, e.g. dev.yourjadomena.pl, and point it to the new folder.
- Log into the back-office in dev, check the URL settings and save them to generate a new .htaccess file. Pay attention to SSL - you probably won't be using it on the dev store.
- On the dev store, enable technical break and add your IP address to the list of accepted addresses.
- Optionally create password protection in .htaccess, and add noindex and nofollow in the template files. This way you can skip including the technical break that comes with adding new IP addresses for users with variable IPs or new developers. To make sure you've secured the dev version correctly you can use the agile and lightweight"Developer Tools for PrestaShop" module.
Problems when using the dev version
Changes you make in the back-office of the production store, i.e. editing products, installing modules, etc., will not be visible in the development store. Such changes are not made in parallel on the dev version to save time. Therefore, once in a while it is worth refreshing the files and database of the development version, so that this one is an accurate representation of the production store.
PrestaShop + Figma
Figma is free in its basic version, a convenient tool for creating graphics for Web and eCommerce. You use the entire workspace for design and communication with your team. Make sure that the graphic designer preparing a new template for your store uses modern tools. A well-done design in Figma will be easily transferred by a programmer to the code of a new template.
PrestaShop + VSC
Visual Studio Code is a free software from Microsoft that is perfect for working on your store files. You can also support git and Docker containers in it.
PrestaShop + git
Git gives you access to the history of everything that has been happening with your files. You can see who, when and what they modified. You can review, evaluate and undo changes. With git you can do a quick synchronization of modifications in files between dev <-> prod versions. It is a must-have for teamwork.
Good tools to make working with git easier are github or gitlab. In addition to visibility into repositories, they allow you to manage users, schedule tasks, etc.
PrestaShop + Docker
Docker also runs the server environment along with the database and files. With Docker, you will fire up copies of your store quickly on your own computer, as well as on any server, without worrying about parameters such as PHP version and configuration, extensions, etc., because this configuration is stored and handled by Docker.
Docker, git and PrestaShop are happy to work together.
You canrun your work on multiple branches (branch) of git. Each branch stores all the information about the store and the changes you are working on. With a few commands, you can run a specific branch from git locally with Docker to review or further develop it. When you finish and test the changes, you can merge them with the branch responsible for the production store.
Server for PrestaShop
The optimal solution for PrestaShop is a server over which we have full root control. Such a server will allow you to develop new skills, and certainly will not limit you when the need for changes comes. Full root access is on offer on most VPS servers, such as at OVH, Digital Ocean, Google Cloud or AWS.
To conveniently manage your server's parameters and add-ons (e.g. mail, antivirus, etc.), it's worth investing in a Server Admin Panel, such as Plesk, which is constantly evolving and receives frequent automatic updates.
For those who are demanding, but don't have the time, we offer server deployment with a dev copy and a complete set of enhancements and tools for convenient work, including Plesk panel, SSL, CloudFlare and a backup system on an external server:
If you would like us to elaborate on any of the points or talk in detail about some tools used when working with PrestaShop let us know in the comments :-)