Fixing a Broken PrestaShop 9.0.3 Back Office After Upgrade: A Community Solution

PrestaShop 9.0.3 Back Office Woes: A Community Steps Up

After upgrading a test site to PrestaShop 9.0.3, a user, Ray UK, reported a critical issue: the back office was inaccessible, redirecting to the front office. Standard troubleshooting steps like clearing the var folder and renaming .htaccess proved ineffective. This issue highlights the potential risks associated with platform updates and the importance of having a robust testing environment.

The initial troubleshooting steps included:

  • Deleting the var folder (which was automatically recreated).
  • Renaming the .htaccess file.
  • Disabling friendly URLs in the database.

Despite these efforts, the back office remained inaccessible.

Identifying the Root Cause and Solution

The breakthrough came when Ray UK discovered a related issue reported on GitHub (https://github.com/PrestaShop/PrestaShop/issues/40695). Through trial and error, the user identified the ps_apiresources module as the culprit. This module, seemingly native to PrestaShop, was causing the back office malfunction.

The solution involved directly manipulating the database:

  1. Accessing the PrestaShop database using phpMyAdmin or a similar tool.
  2. Locating the ps_module table.
  3. Changing the ps_apiresources module's value from 1 to 0 (disabling it).
  4. Renaming or deleting the var folder in the PrestaShop root directory to force its recreation.
-- SQL query to disable the ps_apiresources module
UPDATE ps_module SET active = 0 WHERE name = 'ps_apiresources';

Another user, dhada, suggested an alternative approach involving setting _PS_MODE_DEV_ to true in config/defines.inc.php and then deleting or renaming the ps_accounts and ps_mbo modules.

define('_PS_MODE_DEV_', true); // Add this line to config/defines.inc.php

It's important to note that enabling _PS_MODE_DEV_ is only recommended for debugging purposes and should be disabled in a production environment.

Lessons Learned

This forum thread provides valuable insights into troubleshooting PrestaShop upgrade issues. It highlights the importance of:

  • Checking for related issues on GitHub and other community resources.
  • Understanding the role of modules in PrestaShop functionality.
  • Being comfortable with direct database manipulation (with proper backups, of course).
  • Testing updates in a non-production environment before deploying them to a live store.

While PrestaShop updates aim to improve the platform, they can sometimes introduce unexpected problems. Community-driven solutions, like the one described in this thread, are crucial for maintaining a stable and functional e-commerce site.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools