Cloverfield Database Clean-Up

Keep your website clean and fast with this smart database module.

✓ Instant download ✓ 12 months support ✓ Free updates
Cloverfield Database Clean-Up

About this module

CloverDB Cleanup

Database cleanup module for PrestaShop 7.x to 9.x, multistore ready.

Keep your website fast and clean.


Installation

  1. Download cloverdbcleanup.zip.
  2. In the back office, go to Modules > Module Manager > Upload a module.
  3. Upload the zip and click Install.
  4. The module appears under Advanced Parameters > CloverDB Cleanup.


Upgrading from 1.x: upload the new zip over the existing module. The upgrade script keeps your settings, moves the menu item to Advanced Parameters and moves the backup location to var/modules/cloverdbcleanup/backups/ when the old default (/backups/) was still in use. Move or delete old backups in /backups/ yourself, they are not listed in the module.


Help

Click Help in the module header or the page toolbar for the built-in documentation, available in English, Dutch, German, French, Spanish, Italian and Polish. It opens in the language of your back office and you can switch language on the help page.


Multistore

The module follows the shop context selected at the top of the back office.

  1. All shops: settings are saved as the global default, all tasks clean data of every shop.
  2. Shop or shop group: settings are saved for that selection, cleanup only removes rows of those shops.
  3. Guests (ps_guest) and the e-mail log (ps_mail) have no shop column, so they can only be cleaned in the All shops context.
  4. The faceted search cache and the search index are rebuilt for all shops. They are caches and are safe to run in any context.
  5. The backup location is always global.


Settings

  1. Connection logs older than (default 90 days): ps_connections, _page, _source.
  2. Guests without a visit for (default 90 days): ps_guest, anonymous visitors only.
  3. Keep guests with a cart newer than (default 60 days): guests with a more recent cart are kept.
  4. Search statistics older than (default 90 days): ps_statssearch.
  5. 404 logs older than (default 90 days): ps_pagenotfound.
  6. E-mail log older than (default 90 days): ps_mail.
  7. Backup location (default var/modules/cloverdbcleanup/backups/): absolute path on the server.


Every value must be between 1 and 3650 days.


Usage, step by step

Step 1: Create a backup

Click Create backup. The module writes an SQL dump of all affected tables to the backup location, compressed as .sql.gz when zlib is available. The file name contains the date, time and a random part, e.g. cloverdb_backup_2026-09-30_143022_k3J9xQ2m.sql.gz. The folder is protected with an .htaccess and index.php. On Nginx, make sure the folder is not public (the default var/ folder is blocked in the standard PrestaShop Nginx config).


Step 2: Check the preview

The table Rows that will be removed shows the numbers based on the current settings and shop context. Red numbers indicate a large number of rows. A dash means the table does not exist (for example when the module that owns it is not installed) or is not available in the current shop context.


Step 3: Clean up

Select the tasks and click Start cleanup, then confirm. Rows are removed in batches of 2000, so large tables do not lock the shop.

  1. Connection logs: removes old rows from ps_connections together with the matching rows in ps_connections_page and ps_connections_source.
  2. Old guests: removes anonymous guests (not linked to a customer account) without a recent visit and without a recent cart.
  3. Faceted search cache: empties ps_layered_filter_block, rebuilt automatically on the next category visit.
  4. Search statistics: removes old search terms from ps_statssearch.
  5. 404 log: removes old entries from ps_pagenotfound.
  6. Expired discounts: removes expired catalog price rules (including their conditions and generated prices) and expired specific prices. Prices without an end date are never touched.
  7. E-mail log: removes old entries from ps_mail.


Step 4: Rebuild the search index

Click Reindex for a full reindex via PrestaShop's own search indexer. This can take several minutes for large catalogs.


Restore a backup

The panel Restore a backup lists all backups in the backup location with date, size and PrestaShop version. Click Restore, read the warnings, tick the confirmation box and click Yes, restore.

  1. Restoring replaces the complete tables in the backup, for all shops. Everything that changed in these tables after the backup is lost.
  2. Only possible in the All shops context.
  3. Only backups made by this module can be restored. The file is checked completely before anything is changed.
  4. A backup made with a different PrestaShop version is marked. The table structure may differ.
  5. Put the shop in maintenance mode during the restore and clear the cache afterwards.
  6. Delete removes a backup file from the server.


Good to know

MySQL/MariaDB does not return free space to the disk after deleting rows from InnoDB tables. Run OPTIMIZE TABLE on the large tables (for example ps_connections) via phpMyAdmin afterwards if you want the database files to shrink.


Requirements

  1. PrestaShop 8.0 up to and including 9.x
  2. PHP 7.2.5 or higher (PrestaShop 9 requires PHP 8.1 or higher)
  3. MySQL 5.7 / MariaDB 10.3 or higher
  4. Write permissions on the backup location



Choose your licence

One-time purchase. Instant download after payment.

Starter

€ 59,00

incl. VAT

  • ✓ Keep your website fast
  • ✓ Keep your website clean
  • ✓ Create backups
  • ✓ Restore backups
  • ✓ View table sizes
Buy now
Most popular

Plus

€ 69,00

incl. VAT

  • ✓ Keep your website fast
  • ✓ Keep your website clean
  • ✓ Create backups
  • ✓ Restore backups
  • ✓ View table sizes
  • ✓ Choose which tables to process
  • ✓ Set your retention period
Buy now

Pro

€ 79,00

incl. VAT

  • ✓ Keep your website fast
  • ✓ Keep your website clean
  • ✓ Create backups
  • ✓ Restore backups
  • ✓ View table sizes
  • ✓ Choose which tables to process
  • ✓ Set your retention period
  • ✓ Reindex your database
  • ✓ Clean up your tables
Buy now