Upgrade from 1.5.3 to 2.2.2 error

SQL error in migration: Mysqli prepare error: Unknown column 'name' in 'field list'

  1. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('SELECT id, `n...')</li>
    <li>/Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Db/Adapter/Mysqli.php(388): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'SELECT id, `n...')
  2. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Adapter_Mysqli->prepare('SELECT id, `n...')</li>
    <li>internal function]: Zend_Db_Adapter_Abstract->query('SELECT id, `n...')
  3. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Db.php(79): call_user_func_array(Array, Array)
  4. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php(18): Omeka_Db->__call('query', Array)
  5. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php(18): Omeka_Db->query('SELECT id, `n...')
  6. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Db/Migration/Manager.php(231): removeCollectionNameDescriptionCollectors->up()
  7. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Db/Migration/Manager.php(111): Omeka_Db_Migration_Manager->_migrateUp(Object(DateTime))
  8. Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/controllers/UpgradeController.php(43): Omeka_Db_Migration_Manager->migrate()
  9. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Controller/Action.php(516): UpgradeController->migrateAction()
  10. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('migrateAction')
  11. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
  12. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()
  13. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
  14. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Application.php(79): Zend_Application->run()
  15. /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/admin/index.php(28): Omeka_Application->run()
  16. {main}

Any hints?

In case this helps:

Db Profiler

The following queries were executed during the request:

[0.00032520294189453] SELECT name, value FROM omeka_options

[0.00016117095947266] SELECT plugins.* FROM omeka_plugins AS plugins

[0.0003361701965332] SELECT version FROM omeka_schema_migrations

[0.00023794174194336] SELECT version FROM omeka_schema_migrations

[0.00020599365234375] SELECT version FROM omeka_schema_migrations

[0.00016593933105469] SELECT version FROM omeka_schema_migrations

Executed 6 queries in 0.0014324188232422 seconds

Average query length: 0.00023873647054036 seconds

Queries per second: 4188.7190412783

Longest query length: 0.0003361701965332

Longest query: SELECT version FROM omeka_schema_migrations

Do you have a database backup you can restore from to try the upgrade again? This error is a pretty unlikely one: you'd probably only see it if you first got some error on this same migration, then re-tried the upgrade again afterward.

We need to see the initial error to know what's really happening.

Here is some more from the logs. Not sure any of this helps, but I figure it can't hurt too much.

2014-12-03T11:52:25-06:00 DEBUG (7): SELECT name, value FROM omeka_options
2014-12-03T11:52:25-06:00 DEBUG (7): SELECT plugins.* FROM omeka_plugins AS plugins
2014-12-03T11:52:25-06:00 DEBUG (7): SELECT version FROM omeka_schema_migrations
2014-12-03T11:52:25-06:00 DEBUG (7): SELECT version FROM omeka_schema_migrations
2014-12-03T11:52:25-06:00 DEBUG (7): SELECT version FROM omeka_schema_migrations
2014-12-03T11:52:25-06:00 DEBUG (7): SELECT version FROM omeka_schema_migrations
2014-12-03T11:52:25-06:00 DEBUG (7): SELECT id, name, description, collectors FROM omeka_collections
2014-12-03T11:52:26-06:00 DEBUG (7): SELECT name, value FROM omeka_options
2014-12-03T11:52:26-06:00 DEBUG (7): SELECT plugins.* FROM omeka_plugins AS plugins
2014-12-03T11:52:26-06:00 DEBUG (7): SELECT version FROM omeka_schema_migrations

Ok. Now I go this.

Omeka encountered an error when upgrading your installation.

SQL error in migration: Mysqli statement execute error : Incorrect integer value: '' for column 'html' at row 1

#0 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)

#1 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)

#2 [internal function]: Zend_Db_Adapter_Abstract->query('INSERT INTO `om...', Array)

#3 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Db.php(79): call_user_func_array(Array, Array)

#4 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php(59): Omeka_Db->__call('query', Array)

#5 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php(59): Omeka_Db->query('INSERT INTO `om...', Array)

#6 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php(82): removeCollectionNameDescriptionCollectors->_addElementText(1, 'Collection', 50, false, 'Decorative Pain...')

#7 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php(36): removeCollectionNameDescriptionCollectors->_addTitleElement(Array)

#8 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Db/Migration/Manager.php(231): removeCollectionNameDescriptionCollectors->up()

#9 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Db/Migration/Manager.php(111): Omeka_Db_Migration_Manager->_migrateUp(Object(DateTime))

#10 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/controllers/UpgradeController.php(43): Omeka_Db_Migration_Manager->migrate()

#11 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Controller/Action.php(516): UpgradeController->migrateAction()

#12 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('migrateAction')

#13 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))

#14 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()

#15 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()

#16 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/application/libraries/Omeka/Application.php(79): Zend_Application->run()

#17 /Users/faust/Sites/_clients/Vesterheim/Omeka/omeka222.vesterheim.dev/admin/index.php(28): Omeka_Application->run()

#18 {main}

Okay, I think I see the problem. Your MySQL is set to "strict" mode, so some things that usually silently succeed are showing up as errors instead. Switching off strict mode is one option, but you can also fix the problematic migration easily.

The file that's causing this problem is application/migrations/20121018000001_removeCollectionNameDescriptionCollectors.php. You can make a small change to that file to avoid the issue.

On lines 82, 93, and 108, you want to replace the word false with '0' (the number zero inside single quotes). That should prevent the error.

If you make either change, you'll still have to restore from backup again before starting the upgrade over.

We can make that change as a bugfix to Omeka so this problem won't occur in the future.