You attempted to update your shop, and it is now out of service? Most often, the solution is to deploy a backup. The operation can be delicate, but feasible if you have properly prepared your backups (see the article How to create a backup of my shop).
Here are the steps to restore a backup:
1. Put the store in maintenance mode
Before performing any operation, put your store under maintenance to prevent your customers from landing on an error page. Here's how to proceed depending on your situation (for more details on each technique, see the article How do I put my store under maintenance without access to my back office?)
- If you have access to the configuration file: modify
parameters.phpin the fileapp/config/parameters.php(PrestaShop 1.7+) - If you have access to the database but not to the files: modify
PS_SHOP_ENABLEinps_configuration - You have access to nothing except the FTP: please place a file there.
maintenance.html
Restore the files of the shop.
a. Via FTP.
- Delete the current files from the site (unless you wish to keep certain files such as the logs).
- Transfer the backup of the files (the complete PrestaShop directory that you have backed up) to the server via FTP.
- Ensure that all permissions (chmod) are correctly applied (
755for the directories,644for the files).
b. From the host's interface
Some hosts allow you to restore a complete version of your web space (e.g., daily automatic backup) via their console (cPanel, Plesk, etc.).
3. Restore the database
a. Via phpMyAdmin
- Delete all tables from the current database (or create a new empty database).
- Import your backup file.
.sqlvia the 'Import' tab.- Be careful to maintain the same database version as that of the files.
b. Via command line (advanced option)
mysql -u [utilisateur] -p [nom_bdd] < sauvegarde.sql
4. Check the configuration file
Ensure thatapp/config/parameters.php (orconfig/settings.inc.php for PrestaShop 1.6 and -) contains:
- The correct database identifiers.
- The correct path to the root folder if you have changed servers.
5. Cleanups and restart.
- Manually clear the cache:
- For PrestaShop 1.7+:
var/cache/* - For PrestaShop 1.6:
cache/smarty/compile/andcache/smarty/cache/
- For PrestaShop 1.7+:
- Check the logs in
/var/logs/or/log/in case of errors. - Reload the store in a private browser to test.
| 💡 Test the restoration on a local server: If you have the time, test the restoration in a local environment (XAMPP, MAMP) or a protected subdomain, to ensure that everything works before going back online. |