PrestaShop developer copy
Copy makes it easier to work on your store
Some modifications you make to your online store require changes to files and database.
The work on the store can stretch over time, as it requires analysis, comparison and checking.
A developer's copy of your store will protect you from errors that occur while working with the PrestaShop store code.
Thanks to the copy you will avoid downtime in sales, and the comfort of your work on the developing store will increase .
PrestaShop store copy is a duplicate of the files and database of your production store .
- A store copy gives you control over changes before they reach your customers.
- You can modify the copy without worrying about the functioning of the production store.
- Optimally place the development store on the same server, in a subdomain of your store's domain, e.g. dev.domain.com.
- A well-prepared copy does not interfere with the production store, is invisible to web robots, and is easy to access for you and your colleagues.
PrestaShop copy in 10 steps
Copy your store yourself
1. make a copy of your production store files and database
- Using SSH, connect to your store and package your store files.
- Using PhpMyAdmin, for example, make a database export to a file, such as a zip file.
Useful SSH commands for working with PrestaShop
- # ls - list the files and directories in the directory where you are located
- # cd. - go down to the directory below
- # cd folder_name/ - entering the directory
- # df - area of the entire server
- # du -sh - area of the current folder
- # zip -r filename.zip foldername/ - packing the folder you are in
- # unzip filename.zip - unpacking
- # zip -r filename foldername/ - packing the folder to zip
- # wgetfilename.com/filename.zip - downloading to the folder where you are a file from the Internet
- # rm filetodelete.txt or foldertodelete/- deleting a file or directory
- # mkdir - creating a directory
- # up arrow - last typed ssh commands
- # tab - autocomplete the typed command or file path
2. in your server panel, create a new database and import the created copy of the database into it
- Using the server panel, create a new database.
- Log into the new database via PhpMyAdmin and upload the zip copy you made earlier into the new database.
3 Modify the tables in the new database
- In the new database, using PhpMyAdmin, find the tables:
"ps_shop_url" and "ps_configuration".
- Then substitute the values in PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
to the domain under which your copy of the store will be, such as dev.domain.com
4. create a space on the server for the developer copy files
- On the server, create a new folder and extract the zipped store files to it using SSH.
- The folder for the new store should be outside the directory of your production store.
5. in the extracted files, remove the contents of the folders from the cache
- PrestaShop 1.6:
- PrestaShop 1.7:
6. via FTP edit the file responsible for the connection to the database - enter the data of the new database into the file
- PrestaShop 1.6:
- PrestaShop 1.7:
7. In the server panel, create a subdomain for the copy
- In the server panel, create a subdomain, such as dev.domain.com
- Direct the new subdomain to the folder where the store's developer copy files are located.
8. log into the back office of the store copy and configure the store admin panel
- Log into the back office of the store copy dev.domain.com, check the URL settings and save them to generate a new .htaccess file.
- In the Back Office of the store copy, you can disable SSL if you will not use it in the copy.
9. protect your store copy from indexation and external access
- In the dev.domain.com copy admin panel, enable technical break and add your IP address to the list of accepted addresses.
10. Make your store copy convenient and secure.
To make sure you secure your developer copy properly, use the agile "Developer Tools for PrestaShop" module.
The module will secure your copy with a password so that you don't have to enter IP addresses in the store panel. The module will also add noindex and nofollow, so Google robots won't index your store copy and you'll avoid duplicate content.
Problems when using the dev version
Changes you make in the back-office of the production store such as editing products, installing modules, etc. will not be visible in the development store.
Such changes are not made simultaneously in both versions of the store 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.
Applications useful for working with PrestaShop
In our daily work with our clients' PrestaShop stores, we have developed good practices that, combined with modern tools, streamline and secure team work on the store.
Git gives you access to the history of everything that happened with your files. You can see who, when and what was 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 + VSC
Visual Studio Code is a free software from Microsoft, which is perfect for working on store files. You can also handle git and Docker containers in it.
PrestaShop + Figma
Figma is a free in basic version, a convenient tool for creating graphics for Web and eCommerce.
Make sure that a graphic designer preparing a new template or UI elements 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 + 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 work together
You can run work on multiple branches (branch) of git. Each branch stores all the store information and changes you are working on. With a few commands, you can run a specific branch from git locally with Docker to view or modify it in Visual Studio Conde. Once you've finished and tested the changes, you can send them (merge) to the production store.
Server for PrestaShop
A server optimized for PrestaShop is a guarantee of reliability
The optimal solution for PrestaShop is a server over which you have full root control.
In order to conveniently manage the server's parameters and add-ons (e.g. mail, antivirus, etc.), it is worth investing in a Server Admin Panel, such as Plesk, which is constantly developed 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 operation, including Plesk panel, SSL, CloudFlare and a backup system on an external server.