How to Downgrade a PrestaShop Module After a Bad Update
When Module Updates Go Wrong
You updated a PrestaShop module and now something is broken. Maybe the checkout stopped working, the homepage is throwing errors, or the admin panel has become unresponsive. Module updates can fail for many reasons - incompatible PHP versions, conflicts with other modules, database migration errors, or simply bugs in the new version. Whatever the cause, you need to roll back quickly to restore your store's functionality.
Unfortunately, PrestaShop does not include a built-in "undo" button for module updates. There is no native version history or automatic rollback mechanism for individual modules. This means you need to handle the downgrade manually. This guide covers every method available, from the simplest to the most complex.
Before You Begin - Safety First
Before attempting any rollback procedure, take these precautionary steps -
- Put your store in maintenance mode - Go to Shop Parameters > General > Maintenance and enable it. This prevents customers from encountering errors while you work.
- Create a database backup - Even though you are rolling back, the new module version may have made database changes. Back up your entire database before proceeding.
- Document the current error - Note the exact error messages, which pages are affected, and when the problem started. This information helps if you need to contact the module developer.
Method 1 - Reinstall the Previous Version via Back Office
This is the simplest method and works when you still have access to the PrestaShop admin panel and have the previous version's ZIP file.
Step-by-Step Process
- Navigate to Modules > Module Manager
- Find the problematic module and click Uninstall (NOT "Delete" - uninstall preserves the module's data in the database)
- Confirm the uninstallation
- Click Upload a module at the top of the page
- Upload the ZIP file of the previous working version
- Install and configure the module
Where to Get the Previous Version
- Your email - Most module sellers send download links with each purchase. Check your email for the original version.
- Module marketplace account - On PrestaShop Addons and third-party marketplaces like mypresta.rocks, you can typically download previous versions from your order history.
- Your backups - If you maintain regular backups (you should), you can extract the module folder from a backup archive.
- Contact the developer - Module developers can usually provide older versions upon request.
Method 2 - FTP/SFTP File Replacement
When the admin panel is inaccessible (white screen, 500 error), you need to work directly with files via FTP or SFTP.
Step-by-Step Process
- Connect to your server via FTP/SFTP using a client like FileZilla
- Navigate to
/modules/in your PrestaShop installation directory - Find the module folder (e.g.,
/modules/mymodule/) - Rename the current folder to create a backup - e.g., rename
mymoduletomymodule_broken - Upload the previous version's files into a new
mymodulefolder - Set correct file permissions - directories to 755, files to 644
- Clear the PrestaShop cache by deleting the contents of
/var/cache/prod/and/var/cache/dev/
Important Considerations
When replacing files via FTP, you are only replacing the module's code, not its database entries. If the failed update included database schema changes (new tables, altered columns), the old code may not work with the new database structure. In that case, you will also need to restore the database (see Method 4).
Method 3 - Using the Command Line
If you have SSH access to your server, you can perform the rollback more efficiently from the command line.
# Connect to your server via SSH
ssh user@yourserver.com
# Navigate to PrestaShop root
cd /var/www/html/prestashop
# Backup the broken module
mv modules/mymodule modules/mymodule_broken_$(date +%Y%m%d)
# Extract the previous version
unzip /path/to/mymodule_v1.2.3.zip -d modules/
# Set correct permissions
find modules/mymodule -type d -exec chmod 755 {} \;
find modules/mymodule -type f -exec chmod 644 {} \;
chown -R www-data:www-data modules/mymodule
# Clear PrestaShop cache
rm -rf var/cache/prod/* var/cache/dev/*Method 4 - Full Database Rollback
If the module update included database migrations that need to be reversed, you will need to restore a database backup from before the update.
When You Need a Database Rollback
- The module created new database tables
- The module altered existing table structures
- The module inserted or modified configuration values
- The old module code throws errors about missing or unexpected database columns
Step-by-Step Process
- Identify which tables were affected - Check the module's
install()andupgrade()methods in its main PHP file to see what database changes were made - Restore the relevant tables from your backup -
# Export only module-specific tables from your backup
mysql -u root -p prestashop < backup_before_update.sql
# Or restore specific tables
mysql -u root -p prestashop -e "DROP TABLE IF EXISTS ps_mymodule_data;"
mysql -u root -p prestashop < ps_mymodule_data_backup.sqlWarning - A full database restore will revert ALL changes made since the backup, including new orders, customer registrations, and product modifications. If possible, only restore the tables that the module specifically modified.
Method 5 - Manual Database Cleanup
If you do not have a pre-update database backup, you can manually undo the module's database changes. This requires understanding what the update changed.
Checking What Changed
Open the module's main PHP file and look for upgrade methods -
// Look for files like:
// modules/mymodule/upgrade/upgrade-2.0.0.php
// or methods in the main module file:
public function upgrade($version)
{
if (version_compare($version, '2.0.0', '<')) {
// Database changes made in 2.0.0
Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'mymodule`
ADD COLUMN `new_field` VARCHAR(255)');
}
}To reverse these changes, you would run the inverse SQL -
ALTER TABLE ps_mymodule DROP COLUMN new_field;Cleaning Module Configuration
Modules store configuration in the ps_configuration table. If the new version added broken configuration values, clean them up -
-- Find configuration values added by the module
SELECT * FROM ps_configuration WHERE name LIKE 'MYMODULE_%';
-- Delete problematic configuration entries if needed
DELETE FROM ps_configuration WHERE name = 'MYMODULE_NEW_BROKEN_SETTING';After the Downgrade - Essential Cleanup
Clear All Caches
After any module downgrade, you must clear all caches to ensure PrestaShop loads the correct version -
- Smarty cache - Delete contents of
/var/cache/prod/and/var/cache/dev/ - OPcache - Restart PHP-FPM or Apache to clear the OPcache, or use
opcache_reset() - CDN cache - If you use Cloudflare or another CDN, purge the cache
- Browser cache - Test in an incognito/private window to rule out browser caching
Verify the Module Version
After downgrading, verify that PrestaShop recognizes the correct version -
- Go to Modules > Module Manager
- Find the module and check the displayed version number
- Compare it with the version in the module's main PHP file (
$this->version)
Test Thoroughly
Do not just check the homepage. Test -
- The specific functionality the module provides
- The checkout process from start to finish
- The admin pages where the module adds content
- Mobile and desktop views
- Performance - does the store respond as quickly as before?
Preventing Future Update Problems
Always Back Up Before Updating
Create a complete backup (files and database) before every module update. This is the single most effective safety net.
Test Updates on a Staging Environment
Set up a staging copy of your store and test module updates there first. Only apply the update to production once you have verified it works correctly.
Read the Changelog
Before updating, read the module's changelog or release notes. Look for -
- Breaking changes or compatibility requirements
- Required PHP version changes
- Database migration notes
- Dependencies on other modules or services
Keep Previous Versions
Maintain an archive of all module ZIP files. Organize them by module name and version number so you can quickly find the previous version when needed.
Check Compatibility
Verify that the new module version is compatible with your PrestaShop version, PHP version, and other installed modules. Check the module developer's documentation for any known conflicts.
When to Contact the Module Developer
If none of the above methods resolve the issue, or if you are uncomfortable performing these steps yourself, contact the module developer. Provide them with -
- Your PrestaShop version
- Your PHP version
- The previous module version and the version you updated to
- Exact error messages (check the PrestaShop error log at
/var/logs/) - A list of other modules installed on your store
- Whether you made any customizations to the module
Most reputable module developers will help resolve update issues and may release a hotfix if the problem affects other customers as well.
For more details, read our guides: Module Conflicts: Why Two Good Modules Sometimes Break Each Other and Backup Your PrestaShop Store: Complete Data Protection Guide.
Was this answer helpful?
Still have questions?
Can't find what you're looking for? Send us your question and we'll get back to you quickly.