2

I'm in the middle of upgrading a site to 2.5.3 and just triggered the upgrade script when I recieved the following error.

A Database Error Occurred
Error Number: 1060

Duplicate column name 'show_sidebar'

ALTER TABLE exp_members ADD show_sidebar char(1) NOT NULL default 'y' AFTER quick_tabs

Filename: updates/ud_212.php

Line Number: 53

What is the best way to resolve this. I do have a back up and will revert back shortly if needed.

  • I'm running into a similar issue upgrading from v2.3.1 - Build: date 20111017 I did actually figure out I could comment those lines out when I verified those changes already existed, however.. beginning with ud_009.php it goes on an on through each of the update files which is completely unreasonable to have to manually edit all of these files in order to get the system updated. Is there another solution? – brandrich Dec 12 '13 at 22:11
9

So some quick googling, while MediaGirl was typing, found the answer here.

When EE updates, it’s running through each update file in order, and those update files can be found at /system/installer/updates/. They look like ud_231.php, where 231 is the version number that’s being updated. When EE finishes running through the routines in that update file, the database will effectively be at version 2.3.1. Does that make sense?

If an update fails and you immediately reload the updater and run it again, it will not re-run any update file that has already been completed, but it will re-run an update file that has been started and didn’t complete. Now, what you want to do here is run the updater like normal from 2.1.1. When you encounter a PHP or MySQL error that says it can’t add/remove/modify/database because it does/doesn’t exist (as the case may be), read what’s happening in that error and then go find the update routine that caused it. At this point, it’s a good idea to see what change the updater was trying to make and then go examine your database to see if that change has already been made. If it has, you comment out that part of the updater file, knowing it can skip that part since the change it wants to make has already been made.

Remember that re-running the updater at this point will start over at the beginning of the update file in which you experienced the error, so you’ll want to comment out of that update file the part that caused the error as well as any routines that came before it in that particular update file. Then go back and re-run the updater. You may need to do this a few times if there are a few spots in your database that had already been updated and cause an error this time around.

| improve this answer | |
  • 1
    Exactly this. It's infuriating that the update routines don't include some simple "if not exists" checks, but that's another issue entirely. – adrienne Nov 25 '12 at 2:36
4

Either delete that show_sidebar column in the DB or comment this query out in the upgrade script.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.