News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Duplicate key in "Settings" updating 2.0.11 to 2.0.14

Started by Griffinit, July 23, 2017, 09:01:29 PM

Previous topic - Next topic

Griffinit

PHP version: 5.6.30
phpMyAdmin Version : 4.6.6
MySql server version: 5.6.35
cpanel version 64.0.33

The forum was a fresh install of smf 2.0.11 into which I modified some column names and added/updated/replaced data from a dump of a much older smf forum that was lost, to bring it up to current smf 2.0.11. It has been working OK for about a year now.

I am having problems with updating 2.0.11 to 2.0.14 for my forum.

Installatron (don't know version, can't find it) does this automatically but is sending message update failed.

Technical error:
Error: An error occurred while executing the application API.

Technical Error:
2017-07-03T03:58:38+01:00 SUCCESS [2] http://www.solvussolutions.co.uk/toadfishmonastery/upgrade.php [nofollow]

This is what happens running the update manually

* Updating Settings.
php... Successful. *
+++ Renaming table columns. done.
+++ Converting "log_online". done. Successful. *
+++ Implementing board redirects. done. Successful. *
+++ Creating spider table. done. +++ Removing a spider. done.
+++ Creating spider hit tracking table. done.
+++ Making some changes to spider hit table... done.
+++ Creating spider statistic table. done. Successful. *
+++ Resetting settings_updated. done. +++ Changing stats settings. done.
+++ Enable cache if upgrading from 1.1 and lower. done.
+++ Changing visual verification setting.Unsuccessful! Database error message: Duplicate entry 'visual_verification_type' for key 'PRIMARY' 

I've had a look in table "settings" and 'visual_verification_type' is only in the table once.

Both columns of "Settings" are PRIMARY keys.

Why would it find a duplicate key when there does not appear to be one and what can I do to make the update work?


vbgamer45

You can Delete the entry from the smf_Settings table then try again.

You shouldn't really have to run upgrade.php to go from 2.0.11 to 2.0.4
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kindred

Also, why would you ever have to rename column names? Doing that will probably break your SMF forum in standard usage and will definitely break any attempts to upgrade
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Griffinit

Quote from: vbgamer45 on July 23, 2017, 11:59:03 PM
You can Delete the entry from the smf_Settings table then try again
No, that won't work. As I said, there is only one entry and the update assumes it is there.
Th sql it fails on is UPDATE {$db_prefix}settings
            SET variable = 'visual_verification_type', value = $oldValue
            WHERE variable = 'disable_visual_verification'");

This "update" sql statement is what gives the duplicate primary key.

Quote from: vbgamer45 on July 23, 2017, 11:59:03 PM
You shouldn't really have to run upgrade.php to go from 2.0.11 to 2.0.4

I don't understand what you mean by this.

Griffinit

Quote from: Kindred on July 24, 2017, 07:15:20 PM
Also, why would you ever have to rename column names? Doing that will probably break your SMF forum in standard usage and will definitely break any attempts to upgrade

Where does it indicate column names are being updated? I don't understand.

vbgamer45

If you are going from SMF 2.0.11 to SMF 2.0.14 no major database columns changed...
You can just runt he SMF patch files for the minor versions.

Upgrade.php is if you are going from SMF 1.1.x or early beta/rc versions to 2.0
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

shawnb61

In other words, this is accomplished much more simply by applying the .12, .13 & .14 patches.   
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Griffinit

I was not running upgrade myself. It was Installatron doing it automatically (as I said). I just fished the code out to show the error.

In the end, I determined that deleting the existing ''visual_verification_type' so the "Update" for 'disable_visual_verification' to become 'visual_verification_type' would work.

Installatron has updated to 2.0.14 correctly now.

Kindred

We never, ever recommend using auto installers or auto upgraders
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: