Documentation Akeeba Backup – User's Guide

Red error text (MySQL error 1062) upgrading to Joomla! 2.5.4 or later

If you have used jUpgrade to convert a Joomla! 1.5 site to Joomla! 1.6, 1.7 or 2.5, upgrading your site to Joomla! 2.5.4 or later using Admin Tools or Joomla!'s own updater will result in red error text on the update page mentioning SQL error number 1062 with an error description reading something like:

Duplicate entry '22' for key 'PRIMARY'

Why does that happen? Joomla! 1.6 and later is built on the hypothesis that certain IDs in the menu, assets and extensions tables are free, because this is how its installation is designed to handle database the default contents. As a result, some SQL files in the update packages use those supposedly free IDs to install new features. Unfortunately, jUpgrade squashes those IDs, causing SQL errors during the update. Ergo, the problem is neither with Admin Tools, nor Joomla!. It is a problem created during the upgrade of your site.

In order to work around the issue caused by the 2.5.3 to 2.5.4 upgrade, you will have to run the following SQL command in phpMyAdmin:

INSERT INTO `#__menu` (`menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `ordering`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`) VALUES
('menu', 'com_joomlaupdate', 'Joomla! Update', '', 'Joomla! Update', 'index.php?option=com_joomlaupdate', 'component', 0, 1, 1, 28, 0, 0, '0000-00-00 00:00:00', 0, 0, 'class:joomlaupdate', 0, '', 41, 42, 0, '*', 1);

replacing #__ with your site's database name prefix (the common part of your site's database table names, up to and including the underscore).

At the time of this writing, there is at least one bug tracker item in Joomla! with a proposed workaround, but it's still unknown whether it addresses this issue on all occasions, or if it's going to be included in future versions of Joomla!.

Still need support?

Login or Subscribe to submit a new ticket.

(If filing a bug or you have a pre-sales request, please contact us directly.)