Home / Prestashop / How to Export the Database via Terminal (mysqldump)

How to Export the Database via Terminal (mysqldump)

How to Export the Database via Terminal (mysqldump). Recommended method for PrestaShop 8.x with clear steps, verification, and troubleshooting.

Views: 24 Unique: 17 Updated: 2026-03-17

What this procedure is

This article explains how to export a PrestaShop database via terminal (SSH) using mysqldump. It is useful when phpMyAdmin has size limits.

Applies to: PrestaShop 8.x.

Why you would do this

  • Large backups without browser limits.
  • Server-to-server migrations.
  • Automate backups.

Prerequisites

  • SSH access.
  • Database credentials.
  • Disk space.

Quick diagnosis (before you change anything)

1) Confirm DB name and user

Expected result: you have DB, user, and host ready (check app/config/parameters.php).


Export via terminal (mysqldump)

Step 1) Connect via SSH

Access the server via SSH.

Step 2) Run mysqldump

Example:

mysqldump -u USER -p DB_NAME > prestashop.sql

Expected result: the SQL file is created.

Step 3) Compress the file (recommended)

To reduce size:

gzip -9 prestashop.sql

Step 4) Download and store safely

Download the file and store it off-server.

Final verification

  • The SQL/GZ file exists and is not empty.
  • You can open it and see SQL headers.

If something doesn’t work (common issues)

Permission denied or command not found

  • Ask hosting to enable SSH or use a VPS.
  • Use phpMyAdmin if you do not have SSH.

Best practices

  • Avoid large backups during peak hours.
  • Name backups with date and version.
Back to category