JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"

Need help installing Joomla! 4.x? For all Joomla! 4.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
HJvdK
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Sep 16, 2021 8:25 am

JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"

Post by HJvdK » Thu Sep 16, 2021 8:32 am

Hi,
I"m not an expert and am trying to install Joomla 4, but keep getting this:
JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"
Currently I am on 3.10.2 and want to go to 4.03
Who knows how to solve this?
Thanks

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28197
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"

Post by Per Yngve Berg » Thu Sep 16, 2021 10:33 am

You don't install 4.0 over 3.x. Either install 4.0 in an empty site or use the updater to upgrade an existing 3.10 site.

To see the update to 4.0, change the update channel to "Next Joomla" in the options of the Update component.

HJvdK
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Sep 16, 2021 8:25 am

Re: JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"

Post by HJvdK » Thu Sep 16, 2021 11:40 am

Per Yngve Berg wrote:
Thu Sep 16, 2021 10:33 am
You don't install 4.0 over 3.x. Either install 4.0 in an empty site or use the updater to upgrade an existing 3.10 site.

To see the update to 4.0, change the update channel to "Next Joomla" in the options of the Update component.
Sorry, I wasn't clear about it. The update option you mention is exactly what I am trying.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28197
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"

Post by Per Yngve Berg » Thu Sep 16, 2021 1:10 pm


User avatar
anibal_sanchez
Joomla! Explorer
Joomla! Explorer
Posts: 483
Joined: Sat Mar 17, 2012 3:01 pm
Location: Oviedo, Asturias, Spain
Contact:

Re: JInstaller: :Installeren: Fout SQL Duplicate entry '1' for key 'Primary"

Post by anibal_sanchez » Fri Sep 24, 2021 9:00 pm

Hi,

I found the same issue.

If you are testing the Joomla 4 upgrade; and you test and re-test on the same database. Be sure that you delete everything between each test.

Otherwise, the installer re-creates and re-inserts the same records on the tables that were created in the previous test, and then it fails with the error "JInstaller: :Installer: Found SQL Duplicate entry '1' for key 'Primary'"

Additionally, if there was a previous failed attempt to upgrade to Joomla 4, there could be inconsistencies in the tables.

In my case, this script allowed me to complete the upgrade to Joomla 4:

Code: Select all

# JInstaller: :Installer: Found SQL Duplicate entry '1' for key 'Primary'
DROP TABLE IF EXISTS `#__workflows`;
DROP TABLE IF EXISTS `#__workflow_associations`;
DROP TABLE IF EXISTS `#__workflow_stages`;
DROP TABLE IF EXISTS `#__workflow_transitions`;
DROP TABLE IF EXISTS `#__template_overrides`;
DROP TABLE IF EXISTS `#__finder_links_terms`;
DROP TABLE IF EXISTS `#__finder_logging`;
DROP TABLE IF EXISTS `#__finder_terms_common`;
DROP TABLE IF EXISTS `#__webauthn_credentials`;


# JInstaller: :Install: Error SQL Duplicate entry 'com_config.test_mail-' for key 'PRIMARY'
DELETE FROM `#__mail_templates` WHERE template_id = 'com_config.test_mail';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_contact.mail';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_contact.mail.copy';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.massmail.mail';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.password_reset';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.reminder';
DELETE FROM `#__mail_templates` WHERE template_id = 'plg_system_updatenotification.mail';
DELETE FROM `#__mail_templates` WHERE template_id = 'plg_user_joomla.mail';

DELETE FROM `#__mail_templates` WHERE template_id = 'com_actionlogs.notification';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_privacy.userdataexport';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_privacy.notification.export';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_privacy.notification.remove';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_privacy.notification.admin.export';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_privacy.notification.admin.remove';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.admin_activation';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.admin_activation_w_pw';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.self_activation';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.self_activation_w_pw';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.registration_mail';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.registration_mail_w_pw';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.admin.new_notification';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.user.admin_activated';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_users.registration.admin.verification_request';
DELETE FROM `#__mail_templates` WHERE template_id = 'plg_system_privacyconsent.request.reminder';
DELETE FROM `#__mail_templates` WHERE template_id = 'com_messages.new_message';

# Installer: :Install: Error SQL Table 'j_history' already exists
DROP TABLE IF EXISTS `#__history`;

# JInstaller: :Install: Error SQL Duplicate column name 'extension'
ALTER TABLE `#__mail_templates` DROP `extension`;
Best Regards
@anibal_sanchez - Former JED Team Leader.

Prefix PHP Libraries & Projects: https://php-prefixer.com
My Extensions: https://extly.com


Post Reply

Return to “Installation Joomla! 4.x”