Skip to content

Database backup

Back up the database before any action that changes or deletes data, for example:

  • before the first run of the PrestaShop cleaner module,
  • before uninstalling a module (some modules delete their data),
  • before a major update of a module or PrestaShop.

Deleting records cannot be undone. A backup is the only way back to the data.

One of these ways is enough.

Most hostings offer backups (a full backup or a database backup). The procedure is in your hosting’s documentation. Download the backup off the server as well.

  1. Open phpMyAdmin (usually available from the hosting administration).
  2. Choose your shop’s database.
  3. Click Export and keep the quick export method in the SQL format.
  4. Store the saved file safely.

You find the database name in the file app/config/parameters.php in the PrestaShop root (the database_name field). Do not send the access data in this file to anyone.

On a server with SSH access:

mysqldump -u USER -p DATABASE_NAME > backup.sql

After running the command you enter the database password.

If you edit a module, a backup of the modules/ folder and uploaded files (img/, upload/) is also useful.

A backup you have never tried to restore may not work. At least make sure the file is not empty and contains your shop’s tables (look for CREATE TABLE in the SQL file).

Was this article helpful?