0

A client upgraded their site to 2.5, and I believe the update didn't finish.

At first there was a 500 error. I tried rolling the app back (code only) and it gave an error that the database version didn't support rolling back. Replacing the craft/app directory with a fresh version of 2.5 fixed the 500 error.

The site and some of the admin area work, but in the control panel I cannot access Assets or Entries, I get this error:

CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.craft_elementindexsettings' doesn't exist

So it seems like something with the migration failed. Except must have not been fully failed, because of the error I got about the database version.

The catch is that the client didn't do a database backup before initiating the update, so there isn't a good rollback point.

Could I manually add this table? Any other potentially fixes for this? Is there a way to tell Craft to re-run the migration to 2.5?

  • Unless it's disabled, Craft will automatically perform a DB backup before running an update. Were automatic backups disabled? – Lindsey D Feb 4 '16 at 2:55
  • Oh, thank you. I didn't realize this. Importing that backed up database initiated the migration and the problem is fixed. For anyone finding this unfamiliar with where the automatic backup is, it's /craft/storage/backups – Jason D Feb 4 '16 at 3:27
3

As Lindsey D pointed out in the comment, the answer was to restore the database backup from the automatic backup located in /craft/storage/backups that is generated when the update was initiated.

When this backup is put into place it will re-run the database migration when you visit the Admin area.

So my full solution was 2 steps:

  1. Replace /craft/app with a fresh copy
  2. Restore the automatically backed up database in /craft/storage/backups

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.